ITPub博客

首页 > Linux操作系统 > Linux操作系统 > MySQL基本操作

MySQL基本操作

原创 Linux操作系统 作者:lawzjf 时间:2008-01-18 23:21:13 0 删除 编辑

[mysql@redhat ~]$ cat .my.cnf
[mysql]
user=root
password=root
[mysqld]
datadir=/mysql/mysql-5.0.41-linux-i686/data
[mysql@redhat ~]$ cd /mysql/mysql-5.0.41-linux-i686
[mysql@redhat mysql-5.0.41-linux-i686]$ cd bin
[mysql@redhat bin]$ ./mysqld_safe &
[1] 3316
[mysql@redhat bin]$ Starting mysqld daemon with databases from /mysql/mysql-5.0.41-linux-i686/data
logout
[root@redhat bin]# su - mysql

Good Luck!!


[mysql@redhat ~]$ cd /mysql/mysql-5.0.41-linux-i686/bin
[mysql@redhat bin]$ ./mysqladmin -uroot -proot shutdown
STOPPING server from pid file /var/run/mysqld/mysqld.pid
080118 22:10:49  mysqld ended

[mysql@redhat bin]$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[mysql@redhat bin]$ ./mysql_safe &
[1] 3391
-bash: ./mysql_safe: No such file or directory
[mysql@redhat bin]$ ./mysqld_safe &
[2] 3392
[1]   Exit 127                ./mysql_safe
[mysql@redhat bin]$ Starting mysqld daemon with databases from /mysql/mysql-5.0.41-linux-i686/data

[mysql@redhat bin]$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.41

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

mysql> show databases
    -> ;
+----------------------------+
| Database                    |
+----------------------------+
| information_schema |
| law                                |
| mysql                           |
| test                               |
| testdatadir                  |
+----------------------------+
5 rows in set (0.06 sec)

mysql> use law
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables
    -> ;
+---------------------+
| Tables_in_law |
+--------------------+
| t                          |
| tt                         |
+--------------------+
2 rows in set (0.01 sec)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/37724/viewspace-152667/,如需转载,请注明出处,否则将追究法律责任。

上一篇: The origin of "B-tree"
下一篇: MySQL数据字典
请登录后发表评论 登录
全部评论

注册时间:2008-01-18

  • 博文量
    279
  • 访问量
    934061