MAC osx, change datadir mysql, still not working
Hi i am tearing my hair out at this one, i am a noob ill admit when it comes to mysql, i had ir working perfectly on my local Mac HD, i now want to store the databse to my external as the databse could be 100gb,
Mac osx does not seem to have my.cnf as default in /etc location, so i grabed one "my-huge.cnf" ranmed it and stored it in this folder, i now added the datadir = my/new/location under the field [mysqld] which also contains information such as port and socket,
I also ran cp -R -p /etc/mysql/data /Volumes/Elements/database
to copy my old databse values to the new one, i then changed
datadir = /Volumes/Elements/database
now my database wont work, i tried to restart mysqld, im getting
101130 15:13:11 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
101130 15:13:11 [Warning] Setting lower_case_table_names=2 because file system for /Volumes/Elements/database/ is case insensitive
101130 15:13:11 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
101130 15:13:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
101130 15:13:11 InnoDB: Started; log sequence number 0 44233
mysqld: Too many arguments (first extra is 'restart').
Use --verbose --help to get a list of available options
101130 15:13:11 [ERROR] Aborting
101130 15:13开发者_运维百科:11 InnoDB: Starting shutdown...
101130 15:13:17 InnoDB: Shutdown completed; log sequence number 0 44233
101130 15:13:17 [Note] mysqld: Shutdown complete
When i try and access the database "through my java program in eclipse" i now get "the last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server."
Im officially at a complete loss
Also i think the issue might be with the socket, as when i type mysql in the terminal i get
Can't connect to local MySQL server through socket '/tmp/mysql.sock
A very simple solution would be to symlink your old MySQL data directory to the new location.
ln -s /Volumes/Elements/database /etc/mysql/data
精彩评论