MYSQL: ERROR 1049 (42000): Unknown database 'mysql'
This document (7009762) is provided subject to the disclaimer at the end of this document.
Environment
Situation
mysql --user=root mysql
this command will access the default 'mysql' database, and needs to be done prior to setting or resetting the root users' MySQL password.
Resolution
rcmysql stop pkill mysql (NOTE: wait until notification is given that mysqld ended, then hit <ENTER>) /usr/bin/mysql_install_db
cd /var/lib/mysql ls -al | grep mysql
chown mysql:mysql mysql
Restart the mysql service in safe mode again and attempt the initial command again:
mysql --user=root mysql
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7009762
- Creation Date: 17-Nov-2011
- Modified Date:12-Aug-2022
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com