• Home »
  • »
  • Create Zen Cart MySQL Database And MySQL User

Create Zen Cart MySQL Database And MySQL User

I always forget specific MySQL syntax including creating a MySQL user and granting that user specific access only via localhost to a specific database. So when I install Zen Cart I always end up looking how to do this via the MySQL documentation. Below are simple instructions on how to create a MySQL database using mysqladmin, create a MySQL user, and grant permission to the created database to the created MySQL user.

Create MySQL Database & User For Zen Cart Install:

  1. Create MySQL Database: First use mysqladmin to create the MySQL database you will use for your new Zen Cart installation using the syntax below.

    1. [root@dev ~]# mysqladmin -u root -p create zencartdb
    2. Enter password: ******
    3. [root@dev ~]#

    I suggest using something other than the default of zencart. Once you enter the command you will be required to enter the MySQL root users password.

  2. Create MySQL User: Once the database is created you can login to MySQL using the syntax below and then generate a user also by using the syntax exampled below.

    1. [root@dev ~]# mysql -u root -p
    2. Enter password: *******
    3. Welcome to the MySQL monitor.  Commands end with ; or \g.
    4. Your MySQL connection id is 31
    5. Server version: 5.0.77 Source distribution
    7. Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    9. mysql>
    10. mysql> grant all on zencartdb.* to 'zencart-user'@localhost identified by 'SOME PASSWORD HERE';
    11. Query OK, 0 rows affected (0.01 sec)
    12. mysql>
  3. Flush MySQL Privileges: Now while you are still logged into the MySQL CLI flush the MySQL privileges for the permissions changes to the user created above to take.

    1. mysql> flush privileges;
    2. Query OK, 0 rows affected (0.00 sec)
    3. mysql>

You can now logout of MySQL and proceed with your Zen Cart ecommerce store installation.

Zen Cart Optimization, 2010: SEO Techniques and Performance Optimization (Paperback)

List Price: Click For Price
New From: 0 Out of Stock
Used from: Out of Stock

Zen Cart: E-commerce Application Development: A step-by-step developer’s guide (Paperback)

List Price: $49.99 USD
New From: $31.45 USD In Stock
Used from: $0.24 USD In Stock