注:redhat enterprise linux 4软件包自带
2、数据库的应用
◇启动mysql数据库的服务
(1)、windowxp下 c:\>mysqld 回车即可。(这里将mysql的bin路径加入到环境变量的path中,使其各种路径下都能直接启动)
(2)、linux下 #service mysqld start回车即可。
◇登录数据库
首先要确认服务器处于运行状态。(默认的超级用户名为:root )
c:\> mysql –h hostname -u username –p
enter password:******
hostname为mysql的服务器名或服务器的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: 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) |