查看错误日志,定位到日志最后几行:***@***-VirtualBox:/usr/local/mysql$ more ./data/***-VirtualBox.err
##### 日志内容 start #####
140928 08:52:32 mysqld_safe mysqld from pid file /usr/local/mysql/data/ga
oyu-VirtualBox.pid ended
140928 10:53:01 mysqld_safe Starting mysqld daemon with databases from /u
sr/local/mysql/data
140928 10:53:01 [Note] Plugin 'FEDERATED' is disabled.
140928 10:53:01 InnoDB: The InnoDB memory heap is disabled
140928 10:53:01 InnoDB: Mutexes and rw_locks use InnoDB's own implementat
ion
140928 10:53:01 InnoDB: Compressed tables use zlib 1.2.3
140928 10:53:01 InnoDB: Using Linux native AIO
140928 10:53:01 InnoDB: Initializing buffer pool, size = 128.0M
140928 10:53:01 InnoDB: Completed initialization of buffer pool
140928 10:53:01 InnoDB: highest supported file format is Barracuda.
140928 10:53:01 InnoDB: Waiting for the background threads to start
140928 10:53:02 InnoDB: 5.5.39 started; log sequence number 44664632
140928 10:53:02 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable 'de
fault-character-set=utf8'
140928 10:53:02 [ERROR] Aborting
140928 10:53:02 InnoDB: Starting shutdown...
140928 10:53:03 InnoDB: Shutdown completed; log sequence number 44664632
140928 10:53:03 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
140928 10:53:03 mysqld_safe mysqld from pid file /usr/local/mysql/data/ga
oyu-VirtualBox.pid ended
##### 日志内容 end #####
记得自己为了解决同事的字符编码问题,把自己机器上面的配置文件修改过:修改了/etc/my.cnf里面的【mysqld】的字符设置,在修改回来,试试看,修改方法如下:
把 [client] [mysqld] [mysql]里面的 default-character-set=utf8 都注释掉
发现好使了,可以成功登陆MySQL了。
***@***-VirtualBox:/usr/local/mysql$ sudo /etc/init.d/mysql.server start
Starting MySQL
.... *
***@***-VirtualBox:/usr/local/mysql$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.39-log MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26435490/viewspace-1283327/ ,如需转载,请注明出处,否则将追究法律责任。