开发者

use database is giving the error message

开发者 https://www.devze.com 2023-03-20 04:41 出处:网络
mysql> show databases; ERRO开发者_如何学JAVAR 1018 (HY000): Can\'t read dir of \'.\' (errno: 13)
mysql> show databases;

ERRO开发者_如何学JAVAR 1018 (HY000): Can't read dir of '.' (errno: 13)

I have installed the mysql-server using

apt-get install mysql-server as root.

If I issue command to use other database than mysql it is working properly

mysql> use mysql;

ERROR 1049 (42000): Unknown database 'mysql'

what the issue please help.


To fix this, I added open-files-limit = 2048 to the [mysqld] context in /etc/mysql/my.cnf

Restarted mysql and all came good.

Check: http://i-learnings.blogspot.com.au/2012/11/error-1018-hy000-cant-read-dir-of-errno.html


MySQL may be installed, but no database inside (altough it'd be weird).

Try to issue mysql_install_db.

PATH_TO_MYSQL/scripts/mysql_install_db --user=mysql

Check this out: http://dev.mysql.com/doc/refman/5.1/en/unix-postinstallation.html


You should check your datadir. To find out where MySQL stores data:

SHOW VARIABLES LIKE 'datadir';

Check that directory. It should be owned by mysql.mysql, same for all directories below. Privileges should be drwx------.


Maybe it is caused by this bug. http://bugs.mysql.com/bug.php?id=15851 The suggested fix is to update the directory permissions.

0

精彩评论

暂无评论...
验证码 换一张
取 消