編譯安裝mysql參數:./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all mysql
[root@pyfhblut bin]# ./mysql_install_db --user=mysqlsql
Installing MySQL system tables...
/usr/local/mysql/libexec/mysqld: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/local/mysql/share/mysql/charsets/Index.xml' file
120716 23:01:44 [ERROR] Aborting
120716 23:01:44 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in
/usr/local/mysql/var for more information.
You can try to start the mysqld daemon with:
shell> /usr/local/mysql/libexec/mysqld --skip-grant &
and use the command line tool /usr/local/mysql/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/local/mysql/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /usr/local/mysql/var that may be helpful.
Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/local/mysql/bin/mysqlbug script!
mysql初始化的時候報錯!
解決方法:修改mysql的配置文件my.cnf
character-set-server = utf8mb4 ----> character-set-server = utf8