- Stop the MySQL server process:
$ /etc/init.d/mysql stop
- Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for password:
$
mysqld_safe --skip-grant-tables &
- Connect to mysql server as the root user:
$
mysql -u root
- Setup new mysql root account password and quit:
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit - Restart the MySQL server:
$ /etc/init.d/mysql stop
Thursday, April 22, 2010
Recover MySQL root Password
You can recover MySQL database server's root password with the following five steps.
Monday, April 5, 2010
Make data or tmp web-writable
In a web application, we need to make data or tmp directory writable by the web server. I saw many people achieve this by changing the permission level of that directory recursively to 777 in Unix/Linux:
Now we need to change the ownership of the data or tmp directory and make 'daemon' as the owner.
This is really unnecessary. You can find out on behalf of which user, your web server is running by running this single line of php code:
$ chmod -R 777 tmp
Or
$ chmod -R 777 data
In my case, i got 'daemon' as the user on behalf of which the webserver is running.
echo `whoami`;
Now we need to change the ownership of the data or tmp directory and make 'daemon' as the owner.
$chown -R daemon tmp
Subscribe to:
Posts (Atom)