Thursday, 24 September 2009

Mysql Issues

/var/lib/mysql --> mysql engine operates

To enter into database

mysql -u user -h ip -p 'password' database name

To grant privileges

grant all privileges on database.* to user@localhost identified by 'password';

Backup of Mysql

mysqldump 'database name' > mysql.sql
mysqldump -u 'username' --database 'db_name' > database.sql -p

To restore dump file

mysql 'database name' < mysql.sql
mysql -u 'username' --database 'db_name' < database.sql -p

To repair Mysql

/var/lib/mysql/database myisamcheck -r -s *.MYI

To check the mysql error logs

tail -f /var/lib/mysql/`hostname`.err

No comments:

Post a Comment