mysqlmodecnf

Trying to edit the my.cnf file in mysql and it does not work


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

.


Solution

  • 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.