Log in

View Full Version : Bump: My Sql Fix


Xabob
03-17-2004, 06:10 PM
Found this Digging around for fun

I ran into this, and here's exactly what I did to add a user that could access a database called 'eq' (Full tutorial here)




Added mysql bin path to %path% for system variables (win32 systems, see tutorial linked above)

Open a console
Win98/95/ME - start->run->command
Win2k/XP/2k3 - start->run->cmd
Linux - do you really need to ask?


Type in the following:
mysql -u root mysql


Inside of mysql, type these commands:
create database eq;
grant all privileges on eq.* to myUser@localhost identified by 'myPassword' with grant option;
quit


You should output similar to the following:
Code:

C:\EqEmu\cvs\eqemu\EQEMu Release>mysql -u root mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22 to server version: 3.23.57-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database eq;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on eq.* to myUser@localhost identified by 'myPassword'
with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

C:\EqEmu\cvs\eqemu\EQEMu Release>



Back in the console, type this command to verify the user exists:
mysql -u myUser -p eq


You should see a password prompt - enter in your password ('myPassword' in this sample). You should see the following:
Code:

C:\EqEmu\cvs\eqemu\EQEMu Release>mysql -u myUser -p eq
Enter password: **********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 24 to server version: 3.23.57-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>





Additional help can be found here:
http://www.mysql.com/doc/en/Adding_users.html