4 Installation
see the version of MySQL you are using. (Command line users, remember to add a
semicolon at the end of every line!)
Set Password
By default, root does not have a password. This means that anyone can connect to your
MySQL database server from anywhere on the net, and gain root access the ability to do
anything whatsoever to any database on your server.
So the very first thing you want to do is change your root password.
Click on Custom Query in CocoaMySQL. Type the following command:
set password = old_password(`
NEWPASSWORD
')
This sets the password for the current user.
Something very important to remember in MySQL, however, is that users are not just
described by name, they are also described by where they are coming from. In this way, a
user on the web server can be given different access as the same user on the rest of the
Internet.
When we set up our server, the server set up two root users. One for localhost, and one for
the name of our computer. We need to change the root password for each root user.
1. Click back on the Content tab.
2. Pull down the Databases menu and choose mysql .
3. Click on the user table.
4. You should see a password for localhost root, but not for the other root.
5. Double click, to select, the localhost root's password.
6. Copy the password.
7. Double click the other root's blank password.
8. Paste the password into the blank field.
9. Click in the white area to put the password in.
10. Click Flush Privileges .
This will ensure that both root users have a password.
If you are using the command line, type:
use mysql;
update user set Password=old_password("newpassword") where User="root";
flush privileges;
O
LD
_P
ASSWORD
?
As of MySQL 4.1, MySQL uses a new password scheme. Some client software such as
CocoaMySQL has not yet been updated to take advantage of the new password scheme, and
do not understand it.
When using such software, you need to use old_password() to set your password. For
updated clients, such as the command line client, you can (and should) use password() to