law's homepage
===========================================================
===========================================================

.my.cnf配置文件内容:

[mysql@redhat ~]$ cat .my.cnf
[mysql]
user=root
password=root
[mysqld]
datadir=/mysql/mysql-5.0.41-linux-i686/data
[mysqladmin]
user=root
password=root

启动mysql守护进程:

[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关闭MySQL数据库服务器:

[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]$ ./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服务器:

[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)

连接law数据库:

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)


lawzjf 发表于:2008.01.18 22:14 ::分类: ( MySQL ) ::阅读:(641次) :: 评论 (0)

发表评论
标题

在此添加评论
表情符号: smile laughing tongue angry crying sad wassat wink

称呼

邮箱地址(可选)

个人主页(可选)

 authimage


切换风格
新闻聚合
博客日历
文章归档...
最新发表...
博客统计...
Blog信息
网站链接...