OK, I changed the mysql admin password and forgot it. Can't blame anyone but me!! Would like to blame Kirk just to see Alan laugh but I would have to wait until Decmeber and I can't wait that long.
Nonetheless, the instructions
here I had a problem with in OSX. The first part is with the KILL PID instructions. In OS X
The PID file is in HOSTNAME.pid which resides in /usr/local/mysql/data/. In my case the kill command is `kill `cat /usr/local/mysql/data/127.0.0.1.pid` or '/usr/local/mysql/data/COMPUTERNAME.pid` . Interestingly enough I got a no such pid. So I sudo'd the command and same problem..
Then I had an issue with ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2. Of course, this is solved quickly creating a my.cnf file in /etc to configure mysql. OS X has a nasty habit of defaulting itself and not using this fileand letting the admin decide to handle this configuration if desired.
The configuration if you care to see one format is below:
MySQL /etc for "my.cnf" file. EXMAPLE: /usr/local/mysql/supportfiles/my-large.cnf If you want control than create the file "my.cnf" and copy it inside the /etc folder. An example of MySQL Client, Server and other Configuration is below: [mysqld] datadir=/usr/local/mysql/data socket=/var/lib/mysql/mysql.sock
[mysql.server] user=mysql baserdir=/usr/local/mysql
[client] socket=/var/lib/mysql/mysql.sock
Invocation is a simple shutdown and restart fo the server. |
Confused I ran off to find a different solution.
And I actually found a quicker solution:
Since this failed .... KILL the process with the PID number in /usr/local/mysql/data/127.0.0.1.pid OR '/usr/local/mysql/data/COMPUTERNAME.pid`
I resulted in identifying the number and killed the process as seen below:
# sudo kill 1234
# sudo /usr/local/mysql/bin/mysqld --skip-grant-tables --user=root
mysql> UPDATE user SET Password=PASSWORD('your_new_password') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
Kill server and restart
# mysql -u root -p
Enter password: your_new_password
And thats it.. This works on Windows and LINUX so its a revamp of my August entry.
If you find out what the deal is with the access denied on this command `kill `cat /usr/local/mysql/data/127.0.0.1.pid` OR '/usr/local/mysql/data/COMPUTERNAME.pid` send me a clue... as I am clueless why this does not work.
Im thinking its directory permissions and will look into my laptop as I kill the mysql server with a kill cat command.. something is just not right...
Any thoughts would be welcome?
tags: mysql mysql admin open source open
links: digg this del.icio.us technorati reddit