php - Cannot log in to the MySQL server error
Sorry for posting this error which has been posted so many times and on multiple forums.
I'm having a hard time resolving this issue.OSX Yosemite, 10.10
I installedmysql
usinghome brew
. Can log into mysql as
mysql -u root -p
The password is null.
Then I ran
mysqladmin -u root password ''
, ienull
password for mysqladmin.
I didlocalhost/~username/phpmyadmin/setup
to getconfig.inc.php
I edited it with
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = TRUE;
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
I uninstalled and installed again mysql with homebrew, did all steps again, removed*.err
file which gave socket error.
I tried userroot
with passwordmysql
, ``,password
,my_machine_password
Not a single thing works.!
Inconfig.inc.php
I've following setting:
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
Irestart
apache everytime.
What am I missing?
Nothing seems to let me through it. All posts direct to same steps I've been doing, yet nothing is able to get pass this harrowing process.! Kindly help..
Answer
Solution:
OK. Here's the thing which haunted me for hours. I didn't find this on on any tutorials there. But I found this on youtube videos. When you
brew install mysql
, you will have null as your password. You can change if you'd like to.But also do following:
Step 1:
sudo mkdir /var/mysql
Step 2:
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
Step 3: restart your mysql.server
Now follow phpmyadmin setup instructions. You should be able to get in with your root username, and password.