1.日志文件中有错误“The error means mysqld does not have the access rights to the directory.”
问题原因:MySQL Server访问的datadir权限不对
解决办法:如果datadir是/database/mysql/sql1,则执行如下命令:
# cd /database/mysql/
# chown -R mysql sql1
2. 日志文件中有错误“Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist”
问题原因:datadir目录中没有Mysql Server需要的初始数据文件
解决办法:如果datadir是/database/mysql/sql1,则执行如下命令:
# mysql_install_db --datadir=/database/mysql/sql1
一般创建初始数据文件以后要修改datadir用户权限,参考1
3. 日志文件中有错误“Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm'”
问题原因:MySQL Server访问的datadir权限不对
解决办法:如果datadir是/database/mysql/sql1,则执行如下命令:
# cd /database/mysql/
# chown -R mysql sql1
4. 执行JDBC程序报错“com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'test”
问题原因:mysql.user表中没有对应记录或者密码不对;
解决办法:登录相应的Mysql Server,执行如下命令:
# mysql -P 3307
# grant all on *.* to ''@localhost identified by '';