Newest Downloads

Mar.18

  [zenoss@zenoss2 ~]$ python Zenoss_Template_Manager.py -husage: Examples: python Zenoss_Templa...

How to create a database in MySQL
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>


Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! StumbleUpon! Yahoo! Free Joomla PHP extensions, software, information and tutorials.
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 on Wednesday, 14 May 2008 11:53