MySQL DB Setup

From Nwnx

To start your MySQL database (if it is not started automatically), type in:

C:> C:\\Program Files\\xampp\\mysql\\bin\\mysqld

To create a login in your SQL databse, go to the command prompt and change to the bin directory of your MySQL installation. If you used XApp and installed in the deafult directory, you would type in:

C:> cd C:\\Program Files\\xampp\\mysql\\bin

Then you need to log into the database as root. To do so, type:

C:> mysql -u root

This runs the mysql program and tells it we want to log in as the user (-u) named root. You will see a mysql prompt if you successfully log in:

mysql>

Currently, anyone with access to your box can log in as root. This is not very secure, so we'll add a password for root. For security purposes, you should select a password at least 6 characters long that contains letters, numbers and special characters. If you wanted to set your root password to r00tp@ss! (not recommended), you would type the following at the sql prompt.

mysql> SET PASSWORD = PASSWORD('r00tp@ss!');

Now let's try out our new (secure) root password. To log out of mysql, type:

mysql> exit

Then, to log in again, we type:

C:> mysql -u root -p

At the Enter Password: prompt, type in your password, which will be masked by asterixes. A faster, but less secure way of logging in is to type your password on the command line:

C:> mysql -u root -pr00tp@ss!

Note that there is no space between the -p option and the actual password.

Next, we want to create a database for NWNX to use.

mysql> CREATE DATABASE nwn;

Then NWNX needs an account. If we wanted to create an account with the username nwnx and the password nwnxp@ss, we would type:

mysql> CREATE USER 'nwnx'@'localhost' IDENTIFIED BY 'nwnxp@ss';

Then we need to grant the appropriate privelages. We want to grant the nwnx user all privelages in the nwn database. To do that we type:

mysql> GRANT ALL ON nwn.* TO 'nwnx';

Now we are ready to set up NWNX. You will need to remember three pieces of information: The name of your new database, the name of the user you created, and the user's password.

NWNX Setup Instructions


Personal tools