No Account Yet?

You are not logged in.

Add to: JBookmarks Add to: Facebook Add to: Windows Live Add to: Digg Add to: Del.icoi.us Add to: Reddit Add to: StumbleUpon Add to: Slashdot Add to: Netscape Add to: Furl Add to: Yahoo Add to: Blogmarks Add to: Technorati Add to: Newsvine Add to: Google Information
How to create a database in MySQL E-mail
Database HowTo's - MySQL HowTo's
Written by Allen Sanabria   
Sunday, 10 February 2008 00:02

How to create a database?

  1. By default mysql installs as the root user with no passwd (unless noted otherwise)
    • Verify that mysql is running by one way (out of many ways). This is the command....
      "ps -fe |grep mysqld |grep -v grep"
      The output should be similiar to this... /(usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/lib/mysql/mysql.sock)
  2. Once you verified that mysql is running, log in to mysql using this command
    • Run this command...
      "mysql".
      ... (This should suffice unless your installation of mysql required a username and password)
    • The output should be similar to this..

      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 24365 to server version: 4.1.20

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

      mysql>
  3. Run this command..
    • "Create database TEST;"....Output should look like this...


      Query OK, 1 row affected (0.02 sec)

Now for the all in one Feature......


[root@s15261720 wiki]# ps -e |grep mysqld
7209 ? 00:00:00 mysqld_safe
7242 ? 00:00:12 mysqld

# mysql
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 24415 to server version: 4.1.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

mysql> create database test;
Query OK, 1 row affected (0.00 sec)

mysql>
Comments
Search RSS
Only registered users can write comments!

3.22 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Wednesday, 14 May 2008 11:53 )