I’ve been playing around with mySQL in the command line, and I’ve run into some problems that I haven’t been able to find satisfactory answers to.
-
How do I correctly set up mysql correctly such that I don’t have to type:
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmineverytime to launch mysql from the command line? I am not sure my PATH syntax is correct.
-
To test mysql locally and eventually within a web framework, would it be advisable to set the mysql user to root, and the host to localhost? There seem to be some recommendations against using mysql as a root user.
-
How would I delete all the users currently in my mysql.user and start clean? It seems like I have multiple instances of ‘root’who’s hosts are localhost, 127.0.0.1, (::1, localhost, username.local)? What’s going on here?
edit or create a .profile in your home directory and add:
Open a new terminal window for the changes to take effect.
In general you shouldn’t use root. You can change the username in MySQL 5.02 or higher:
To delete a user: