Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql client setting no-auto-rehash conflicting with mysqldump

Our database has many tables with many columns. It takes a long time for the commandline mysql client to connect unless I pass it -A. I'd rather not have to put that in every time, so I tried adding the my.cnf option no-auto-rehash.

That works great until I have to use mysqldump:

mysqldump: unknown option '--no-auto-rehash'

Apparently mysqldump uses the options in my.cnf's [client] section, even if there is a separate [mysqldump] section. Is there any way to use no-auto-rehash and still have a functional mysqldump? Is there a [no-really-just-the-mysql-client] section?

Thanks.

The same question was asked on the mysql forums with no response:

http://forums.mysql.com/read.php?35,583759,583760

like image 965
Greg Avatar asked May 22 '13 14:05

Greg


People also ask

Is Mysqldump part of MySQL?

Mysqldump is part of the relational database package for MySQL. It is used to back up all the data in a database into a single text file. These files or "dumps" can be generated for individual databases or a collection of them.

What is the client for MySQL to connect from command prompt?

Enter mysql.exe -uroot -p , and MySQL will launch using the root user. MySQL will prompt you for your password. Enter the password from the user account you specified with the –u tag, and you'll connect to the MySQL server.


2 Answers

Put no-auto-rehash option in the [mysql] section, instead of [client]

[mysql]
no-auto-rehash

In this case mysqldump is functional.

like image 70
QArea Avatar answered Oct 15 '22 16:10

QArea


I do this all the time:

[client]
compress
user=uuuuuuu
password=ppppppppp

[mysql]
prompt=\h\_\d>\_
no-auto-rehash

[mysqldump]
quick
max_allowed_packet=1G
like image 29
user3665831 Avatar answered Oct 15 '22 15:10

user3665831