学习hibernate框架,以前一直用的是sql server ,现在想学一下mysql.
用了个第三方可视化工具navicat Premium,在cmd下运行mysql -uroot -p时报错,原来是没有配置环境变量
在Windows平台下,需要将mysql路径添加到环境变量中:
1.右键点击“我的电脑”-“属性”-“高级”-“环境变量”-“系统变量”-双击“Path”-将mysql的路径“D:wampbinmysqlmysql5.0.51bbin(这里假设您的MYSQL目录和我安装的一样,其实你定位到你的MYSQL安装目录之后再找到bin目录就可以把全路径写上去了)”添加进去-“确定”
2.添加完毕之后,再到DOS下进行测试:
C:>mysql -u root -p
Enter password: **********
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 21
Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.
mysql>
出现了mysql>就表示成功了!