mysql登陸報錯mysql: unknown variable 'basedir=
使用mysql登陸資料庫報錯
[root@localhost ~]# mysql -uroot -p
mysql: unknown variable 'basedir=/usr'
報錯原因:
配置檔案裡面的格式有誤,[mysqld]寫成了[mysql]
[root@localhost step]# cat /etc/my.cnf
[mysql]
basedir = /usr
datadir = /var/lib/mysql
log-error = /var/lib/mysql/localhost.localdomain.err
pid-file = /var/lib/mysql/localhost.localdomain.pid
log-bin=/var/lib/mysql/mysqld-bin
binlog_format=row
binlog-do-db=dmcdbTEST
解決方法:
將[mysql]改為[mysqld]
[root@localhost step]# cat /etc/my.cnf
[mysqld]
basedir = /usr
datadir = /var/lib/mysql
log-error = /var/lib/mysql/localhost.localdomain.err
pid-file = /var/lib/mysql/localhost.localdomain.pid
log-bin=/var/lib/mysql/mysqld-bin
binlog_format=row
binlog-do-db=dmcdbTEST
之後重啟資料庫
[root@localhost mysql]# mysqladmin -uroot -p shutdown
[root@localhost mysql]# mysqld_safe --defaults-file=/etc/my.cnf &
資料庫可以正常連線
[root@localhost ~]# mysql -uroot -p
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.21-70.1 Percona Server (GPL), Release 70.1, Revision 698
Copyright (c) 2009-2014 Percona LLC and/or its affiliates
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> show global variables like '%double%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| innodb_doublewrite | ON |
+--------------------+-------+
1 row in set (0.00 sec)
[root@localhost ~]# mysql -uroot -p
mysql: unknown variable 'basedir=/usr'
報錯原因:
配置檔案裡面的格式有誤,[mysqld]寫成了[mysql]
[root@localhost step]# cat /etc/my.cnf
[mysql]
basedir = /usr
datadir = /var/lib/mysql
log-error = /var/lib/mysql/localhost.localdomain.err
pid-file = /var/lib/mysql/localhost.localdomain.pid
log-bin=/var/lib/mysql/mysqld-bin
binlog_format=row
binlog-do-db=dmcdbTEST
解決方法:
將[mysql]改為[mysqld]
[root@localhost step]# cat /etc/my.cnf
[mysqld]
basedir = /usr
datadir = /var/lib/mysql
log-error = /var/lib/mysql/localhost.localdomain.err
pid-file = /var/lib/mysql/localhost.localdomain.pid
log-bin=/var/lib/mysql/mysqld-bin
binlog_format=row
binlog-do-db=dmcdbTEST
之後重啟資料庫
[root@localhost mysql]# mysqladmin -uroot -p shutdown
[root@localhost mysql]# mysqld_safe --defaults-file=/etc/my.cnf &
資料庫可以正常連線
[root@localhost ~]# mysql -uroot -p
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.21-70.1 Percona Server (GPL), Release 70.1, Revision 698
Copyright (c) 2009-2014 Percona LLC and/or its affiliates
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> show global variables like '%double%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| innodb_doublewrite | ON |
+--------------------+-------+
1 row in set (0.00 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2142628/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- pbootcms模板報錯提示PHP Warning: Unknown: open_basedir restrictionbootPHPREST
- JDBC/MYSQL問題 : Unknown system variable 'query_cache_size'JDBCMySql
- MySQL 中出現報錯提示: ‘Variable ‘XXX‘ is a read only variable‘的解決方法MySql
- mysql 8.0 使用 navicat 登入報錯MySql
- MySQL登陸命令列引數MySql命令列
- 盤點Mysql的登陸方式MySql
- mysql Unknown error 1054MySqlError
- sql mysql variable autocommit (5)MySqlMIT
- MySQL 遠端登陸踩坑記MySql
- MySQL login-path 本地快捷登陸MySql
- mysql執行報錯mysql.sockMySql
- mysql關於variable的總結MySql
- Mysql8.0 報錯MySql
- mysql登入報錯提示:ERROR 1045 (28000)的解決方法MySqlError
- mysql遇到Variable can’t be set to the value of ‘NULL’MySqlNull
- 白日夢的MySQL專題(第33篇):各種登陸MySQL的騷操作MySql
- mysql 報錯 Communications link failureMySqlAI
- MySql報錯(持續更新)MySql
- mysql checksum 報錯問題。MySql
- centos6.8安裝mysql並配置遠端登陸CentOSMySql
- MySQL:ERROR 1286 (42000): Unknown storage engine 'MyISAM'MySqlError
- mysql Unknown column ‘‘ in ‘field list‘解決方案MySql
- mysql 動態引數(Dynamic System Variable Summary)MySql
- mysql 啟動報錯Can't connect to local MySQL server through socket '/data/mysql/mysql/mysql.sock'(111)MySqlServer
- mysql報錯程式碼彙總MySql
- nginx 啟動報錯 unknown directive "server"NginxServer
- Vuex中使用報錯unknown mutation typeVue
- FastCGI sent in stderr: "Primary script unknown" 報錯AST
- Mysql:Variable 'XXXt' can't be set to the value of 'NULL'解決MySqlNull
- [BUG反饋]onethink 登陸時呼叫$User = new UserApi; 報錯。API
- 報錯install_driver(mysql) failed: Attempt to reload DBD/mysql.pmMySqlAI
- Navicat連線centos裡mysql報錯Host is not allowed to connect to this MySQL serverCentOSMySqlServer
- thinkphp5 寶塔安裝報錯 open_basedir restriction in effectPHPREST
- MySQL查詢取別名報錯MySql
- Mysql自動處理同步報錯MySql
- mysql5.6 mysqldump備份報錯MySql
- MySQL更新卡住報錯lock wait timeoutMySqlAI
- 帝國cms登陸錯誤次數 帝國cms登陸錯誤次數超過
- Mysql資料庫報ERROR 1045 (28000)報錯及MySQL忘記密碼找回MySql資料庫Error密碼