一、mysql数据库的安装
Windows下MySQL的配置
以 MySQL 5.1 免安装版为例, 下载 mysql-noinstall-5.1.69-win32.zip ( 官方下载页: http://dev.mysql.com/downloads/mysql/5.1.html#downloads )
1.打开mysql-5.0.18-win32文件夹,然后点击setup.exe
2、点击next
3、选取“custom”,点击next
4、点击“change”,改变安装路径,然后点击next
5、点击“install”后,等待几秒钟,出现图
6、点next
7、点next
8、点“finish”,进入数据库配置
9、点next
10、点next
11、选取“Server Machine”,点“next”
12、点“next”
13、点“next”
14、点“next”
15、点“next”
16、选取“Manual Selected Default Character Set /Collation”,然后选取字符集为“GBK”,点“next”
17、修改ServiceName mysql5018,点“next”(注:此处贵行需写的是mysql5018,因为现在你要装的是mysql 5.0.18版本的mysql)
18、去掉“Modify Security Settings”选取,点Next
19、点击Execute
20、Mysql 安装完毕
二、测试是否能连接上数据库,刚装好数据库没有密码
→ Window+R 输入cmd 打开dos
→ C:\Users\Dell>cd/
→ C:\>d:
→ D:\>cd D:\Program Files\MySQL\MySQL Server 5.0\bin
→ D:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
→ mysql>
三、给root用户添加密码root
方法1:
→ D:\Program Files\MySQL\MySQL Server 5.0\bin>mysqladmin -u root -p password
Enter password: ****
mysqladmin: Too few arguments to change password
→ D:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -u root -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
→mysql>