0

Operating System - OSX 10.11.2

MAMP version - 3.5


I'm following along with this guide, setting up wordpress with Xammp on PC and MAMP on Mac, where I'm in step "Mac - 4" is asked to input:

"In the Terminal run: /Applications/MAMP/Library/bin/mysqladmin -u root -p password {Your Windows MySQL password here}"

However, this (with out bracket text) results in error message:

error: 'Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/Applications/MAMP/tmp/mysql/mysql.sock' exists!

Looking into given directory directory there are no mysql.sock file.

Trying to start MAMP anyway (without configuring mysqladmin) results in error log:

160113 20:42:10 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql
160113 20:42:10 [Warning] Setting lower_case_table_names=2 because file system for /Applications/MAMP/db/mysql/ is case insensitive
160113 20:42:10 [Note] Plugin 'FEDERATED' is disabled.
160113 20:42:10 InnoDB: The InnoDB memory heap is disabled
160113 20:42:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160113 20:42:10 InnoDB: Compressed tables use zlib 1.2.3
160113 20:42:10 InnoDB: Initializing buffer pool, size = 128.0M
160113 20:42:10 InnoDB: Completed initialization of buffer pool
160113 20:42:10 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
160113 20:42:10  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
160113 20:42:10  InnoDB: Waiting for the background threads to start
160113 20:42:11 InnoDB: 5.5.42 started; log sequence number 139375528
160113 20:42:11  InnoDB: Warning: table 'wordpress/wp_posts'
InnoDB: in InnoDB data dictionary has unknown flags 50.
160113 20:42:11 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160113 20:42:11  InnoDB: Warning: table 'wordpress/wp_postm160113 20:42:11 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
eta'
InnoDB: in InnoDB data dictionary has unknown flags 50.
160113 20:42:11 [Note] Server socket created on IP: '0.0.0.0'.
160113 20:42:11 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
160113 20:42:11 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
0

According to Troubleshooting a MySQL Installation Reference Manual (it's for Windows, but it should be the same for other systems), the error:

Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist

can occur when the MySQL base or data directories are installed in different locations. This could happen when you upgraded and installed to a new location, but you're using old configuration file. If that's the case, be sure to rename any old configuration files when upgrading MySQL.

Otherwise please edit your my.ini and double check that basedir and datadir (in [mysqld] section) are pointing to the right location.

If they're correct, try recreating MySQL core structure using the following command:

sudo mysql_install_db –-user=mysql –ldata=/YOUR/datadir

If above won't help, please re-install your MAMP/mysql from scratch.

  • I reinstalled MAMP. Works fine with default mysql-folder. Now, trying to enter: /Applications/MAMP/Library/bin/mysqladmin -u root -p password in terminal results in: "error: 'Can't connect to local MySQL server through socket ...' – user3789629 Jan 13 '16 at 20:54
  • @user3789629 Check by mysql_config --socket where is your socket file and if it's correct (/Applications/MAMP/tmp/mysql/mysql.sock), otherwise update it in your my.cnf. See this post, it's Drupal focused, but still could help. – kenorb Jan 13 '16 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.