Users and Rights
ex.: cd /usr/local/mysql/bin ( Unix or Linux ) or cd c:\mysql\bin ( Windows )
ex.: mysql -u username -p The -h hostname argument described bofore is optional, and I tend to leave it off unless I cannot get into MySQL otherwise. If you set the root user password then it's time to use it now.
ex.: USE Test
ex.: exit Users and Privileges Finally, there is the option of limiting users to particular hostnames. The hostname is either the name of the computer on which the MySQL server is running (localhost being the most common value here) or the name of the computer from which the user will be accessing the server. This can even be an IP address, should you choose. To specify a particular host, change your statement to the following; ex.: Grant all on database.* To username@hostname Identified by 'password' To allow for any host, use the hostname wildcard character (%). ex.: Grant All on database.* To username@'%' Identified by 'password' To Create New Users
ex.: mysql -u root -p
ex.: create database alpacas; create database movies;
ex.: Grant select, insert, delete, update, create, drop, alter, index on alpacas.* To llama@localhost IDENTIFIED By 'camel';
ex.: Grant select on alpacas.* To webuser@'%' IDENTIFIED BY 'browsing'; Grant select on movies.* To webuser@'%' IDENTIFIED BY 'browsing';
ex.: quit
ex.: bin/mysqladmin -u root -p reload |

