Help Desk Help Desk   Live Chat Live Chat   Phone +1 (917) 409-7605 M-F 9am-6pm EST
Free Trial
Client Login
Help Desk
Help Desk » 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 password of your choice.  In this example, the database for the PHP Live! system will be phplive_db, the login is phplive_user and the password is password.  The phplive_user will only have access to the database created by the phplive_user 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.

  5. Exit the MySQL command line.

  6. Login as the new MySQL user you previously 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 to provide for 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 many other database administration. If you are not familiar with PHPMyAdmin, visit their website, download it and deploy it on your web server.

Was this helpful?
could be more helpful? let us know
5 people found this helpful