环境变量设好,在开始菜单->运行->CMD,执行MySQLD,或是直接切换到C:MySQL5.1.40bin目录双击运行MySQLD.exe服务程序,也可以服务的形式运行: 注意mysql安装目录不要有中文或空格,在SDK开发中,如QT会有意想不到的问题;
安装服务 mysqld -install
启动服务 net start mysql
停止服务 net stop mysql
删除服务 mysqld -remove
再打开一个CMD窗口,执行MySQL -h localhost回车,就可以看到
{
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 5
Server version: 5.1.40-community MySQL Community Server (GPL)
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
}
表示成功连接到MySQL了数据库了,接下来,可以查看数据库,
->show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.01 sec)
->use test;
Database changed
--可以支持常量表达式和MSSQL或Oracle的select 444+44 from dual一样;
mysql> select 444+44;
+--------+
| 444+44 |
+--------+
| 488 |
+--------+
1 row in set (0.00 sec)