mysql数据库的学习[2]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 sharp2001 的 blog

注:redhat enterprise linux 4软件包自带4.1.7

 

2、数据库的应用

◇启动mysql数据库的服务

(1)windowxpc:\>mysqld 回车即可。(这里将mysqlbin路径加入到环境变量的path中,使其各种路径下都能直接启动)

(2)linux  #service mysqld start回车即可。

◇登录数据库

首先要确认服务器处于运行状态。(默认的超级用户名为:root )

c:\> mysql –h hostname -u username –p

enter password:******

hostnamemysql的服务器名或服务器的ip

username为用户名

*****为用户密码

◇ 本地测试:

>mysql -h localhost -u root -p

enter password: ******

welcome to the mysql monitor.  commands end with ; or \g.

your mysql connection id is 9 to server version: 4.1.10a-nt

 

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

 

mysql>

 

◇ 显示当前用户可操作的数据库:用show命令

mysql> show databases;

+----------+

| database |

+----------+

| mysql   |

| test     |

+----------+

2 rows in set (0.00 sec)

本文关键:mysql数据库的学习
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top