Perhaps you are a little lost on certain MySQL basics like user creation , beleive me , it happened to me a lot , I always forgot the damn command to create a new user on MySQL server. Its easy ... follow these basic steps
This Article is intended for intermediate users. You will need to connect to MySQL Client with the following command: #> mysql -h localhost -u user -p yourpass Where -h stands for host , -u for user name to connect to MySQL and -p the password you use to connect. MySQL gives the ability to add new users using GRANT commands , so for example lets say you want to create an user called 'bob' that will connect from a remote location with ip address 10.0.0.1 and with a password 'mike0011' and will only read from a database called MIKEDB The command to achieve something like this would be: #> grant select on MIKEDB.* to 'bob'@'10.0.0.1' identified by 'mike0011' with grant option; After you run this command then is a good idea to flush privileges: #> flush privileges; Simple ah ? Lets say you want to create an user that can connect from any host and has all privileges on the database , you would run something like this: #> grant ALL PRIVILEGES on MIKEDB.* to 'bob'@'%' identified by 'mike0011' with grant option; Dont forget to flush privileges ! As a last example , lets say you want to give select and insert permissions on a table called USERS on MIKEDB for a user that will connect from any location: #> grant select , insert on MIKEDB.USERS to 'bob'@'%' identified by 'mike0011' with grant option; Im pretty sure that with some common sense and the help of the previous examples you will be able to make up any combination you need based on your requirements... So as usual , I do hope this was usefull. Regards Felipe Cruz |