问题:
I'm attempting to use cat /etc/my.cnf in mysql but when I do this, it just shows -> wanting me to keep putting in inputs.
However, when I put a semicolon at the end....
可以将文章内容翻译成中文,广告屏蔽插件会导致该功能失效:
问题:
I'm attempting to use cat /etc/my.cnf in mysql but when I do this, it just shows -> wanting me to keep putting in inputs.
However, when I put a semicolon at the end.
cat /etc/my.cnf;
it throws an error.
How can I edit the /etc/my.cnf file?
I'm running this on terminal on a Mac and I got into the mysql server by using the command
sudo /usr/local/mysql/bin/mysql -u root
.
回答1:
Are you typing this in to the mysql>
shell? If so, UNIX-shell commands like cat
won't do anything useful. These aren't commands MySQL knows how to deal with.
You need to run these in a plain Terminal (shell) window outside of MySQL.
By default most systems launch the bash
shell which has access to command-line tools like vi
, etc. The MySQL shell is SQL only.
回答2:
It seems you are trying to edit MySQL configuration from MySQL shell but that will not work. Follow below steps to edit the file
- Open terminal and type below command to open mysql config file in textedit
- sudo nano /etc/my.cnf
- Save the file and restart MySQL
Hope this helps you