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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 新搭建的mysql登陸報錯mysql Segmentation fault (core dumped)MySqlSegmentation
- MySQL 報錯'Variable 'XXX' is a read only variable'MySql
- 配置OGG到MYSQL複製時登陸MYSQL報錯解決MySql
- MySQL命令列登陸,遠端登陸MySQLMySql命令列
- mysql密碼遺忘和登陸報錯問題MySql密碼
- MYSQL5.5修改字符集報錯:unknown variable 'default-character-set=utf8'MySql
- pbootcms模板報錯提示PHP Warning: Unknown: open_basedir restrictionbootPHPREST
- JDBC/MYSQL問題 : Unknown system variable 'query_cache_size'JDBCMySql
- mysql 8.0 使用 navicat 登入報錯MySql
- MySQL 中出現報錯提示: ‘Variable ‘XXX‘ is a read only variable‘的解決方法MySql
- 盤點Mysql的登陸方式MySql
- MySQL登陸命令列引數MySql命令列
- 因login-path導致MySQL 啟動[ERROR]unknown variable 'password=*****'MySqlError
- windows 下用 as sysdba登陸報錯Windows
- mysql匯入報錯Variable 'sql_notes' can't be set to the value of 'NULL'MySqlNull
- MySQL 遠端登陸踩坑記MySql
- MySQL login-path 本地快捷登陸MySql
- mysql在Linux下登入正常,但是用Navicat登入報錯MySqlLinux
- Mysql鬧鬼!不要密碼也能登陸薦MySql密碼
- mysql執行報錯mysql.sockMySql
- sql mysql variable autocommit (5)MySqlMIT
- SELECT INTO FROM mysql Undeclared variableMySql
- unknown variable 'defaults-file=/home/mysql/my3310.cnf'--percona server 5.7MySqlServer
- MySQL DROP TABLE刪除表報錯'ERROR 1051 (42S02): Unknown table'MySqlError
- Mysql8.0 報錯MySql
- 解決Mysql中只能通過localhost登陸不能通過ip登陸的問題MySqllocalhost
- MySQL服務開啟關閉及登陸- 2MySql
- mysql Unknown error 1054MySqlError
- mysql關於variable的總結MySql
- mysql還原資料庫遇到Unknown command 錯誤MySql資料庫
- 白日夢的MySQL專題(第33篇):各種登陸MySQL的騷操作MySql
- centos6.8安裝mysql並配置遠端登陸CentOSMySql
- MySQL 5.6 關於登陸的初始化設定MySql
- MySql報錯(持續更新)MySql
- mysql checksum 報錯問題。MySql
- MYSQL SOURCE報錯 ERROR: ASCIIMySqlErrorASCII
- mysql遇到Variable can’t be set to the value of ‘NULL’MySqlNull
- mysql登入報錯提示:ERROR 1045 (28000)的解決方法MySqlError