PHP Live! Help Desk
Search:
» Help Desk Home » Installation and Upgrade » MySQL command line examples to create a user and database for PHP Live!
MySQL command line examples to create a user and database for PHP Live!

MySQL command line to create a user and database for the PHP Live! system.

 

  1. Login to the MySQL command line.
    mysql -u root -p

  2. Find the MySQL host name.
    SELECT host FROM information_schema.processlist;

    The output will be the hostname (typically localhost).  In this example, we will assume it is localhost.

  3. Create the MySQL user for the PHP Live! system.  Replace the phplive_user with the login of your choice and the password to the user's password your choice.  In this example, the database for PHP Live! will be phplive_db (update the name to your choice).  The phplive_user will only have access to the database created by the user.  The database phplive_db will be created in the next few steps.  We will assign the user to the database here.
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON phplive_db.* TO 'phplive_user'@'localhost' IDENTIFIED BY 'password';

  4. Activate the user account and access.
    FLUSH PRIVILEGES;

  5. Exit the MySQL command line.
    exit;

  6. Login as the new MySQL user you have just created.
    mysql -u phplive_user -p

  7. Create a database for the user.
    CREATE DATABASE phplive_db;

  8. From the above example, the MySQL information that should be provided on the PHP Live! installation is:
    Database Name: phplive_db
    Database Host: localhost
    Database Login: phplive_user
    Database Password: password

 

Front-end MySQL tool recommended:

A front-end MySQL database viewing tool such as PHPMyAdmin is great for creation of databases and other database administration. If you are not familiar with the PHPMyAdmin, visit the site, download it and deploy it on your web server. It will save you time, greatly.

Was this helpful?
could be more helpful? let us know