Recent Changes - Search:

Softwares

.

HowToCreateMySQLDatabaseAndCREATEAndGRANTPrivileges

Main.HowToCreateMySQLDatabaseAndCREATEAndGRANTPrivileges History

Hide minor edits - Show changes to output

May 24, 2007, at 06:37 AM by 202.56.231.116 -
Added lines 1-33:
%blue %HOW TO CREATE THE MySQL DATABASE

This step is only necessary if you don't already have a database set-up . In the following examples, 'username' is an example MySQL user which has the CREATE and GRANT privileges. Use the appropriate user name for your
system.

First, you must create a new database for your site (here, 'databasename' is the name of the new database):

mysqladmin -u username -p create databasename

MySQL will prompt for the 'username' database password and then create the initial database files. Next you must login and set the access database rights:

mysql -u username -p

Again, you will be asked for the 'username' database password. At the MySQL prompt, enter following command:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
ON databasename.* TO 'username'@'localhost' IDENTIFIED BY 'password';

where

'databasename' is the name of your database
'username@localhost' is the username of your MySQL account
'password' is the password required for that username

Note: Unless your database user has all of the privileges listed above, you will not be able to run site on that database.

If successful, MySQL will reply with:

Query OK, 0 rows affected

To activate the new permissions, enter the following command:

FLUSH PRIVILEGES;
Edit - History - Print - Recent Changes - Search
Page last modified on May 24, 2007, at 06:37 AM