1 | Open Port 3306 | This is the MySQL default port for communition, so it needs to be openned for people to be able to access the server. Since this is a general query I have placed it into one of the other Tech notes. Click Here for the details of how to do it. |
2 | Set up Users | Adding a
new MySQL user is very simple. When logged in as root, just
do the following: [root@e-smith
/root] # mysql mysql> GRANT ALL PRIVILEGES ON databasename.* TO newuser IDENTIFIED BY 'password'; The command isn't case sensitive; it's just written above in mixed case to distinguish the commands (in caps) from the parameters (in lowercase). Note that this command gives newuser full access to the database. For better security, you should identify exactly what privileges are needed and grant only these privileges with something like this: mysql>
GRANT SELECT, UPDATE, INSERT, DELETE ON databasename.* TO newuser
IDENTIFIED BY 'password'; You can also set up a user to have only access from the local machine like this: mysql> GRANT ALL
PRIVILEGES ON databasename.* TO newuser@localhost IDENTIFIED BY
'password'; Or if you wish, you can also set up a user to a particular machines IP number, like this: mysql> GRANT ALL
PRIVILEGES ON databasename.* TO newuser@10.0.0.25 IDENTIFIED BY
'password'; If you're running phpMyAdmin, you can also add users through the "Users" link on the main page. That way, you don't have to worry about dealing with the command line at all, and you get checkboxes for all the privileges. There is no relationship between MySQL users and system users, so there's no need to create a system user to match the new user created for MySQL. |