Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql login error mysql: unknown variable & # 039 investors basedir =

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Using mysql to log in to the database to report an error

[root@localhost] # mysql-uroot-p

Mysql: unknown variable 'basedir=/usr'

Reason for reporting an error:

The format in the configuration file is incorrect. [mysqld] is written as [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

Solution:

Change [mysql] to [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

Then restart the database

[root@localhost mysql] # mysqladmin-uroot-p shutdown

[root@localhost mysql] # mysqld_safe-- defaults-file=/etc/my.cnf &

The database can connect normally.

[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)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report