重新安装mysql的心得
曾经失败过n次,让我相当无奈最后终于找到了一个解决方案,供大家分享
删掉注册表的方法,我也曾经用过,但总是失败,建议如下
一:先卸载软件mysql
二:先删注册表的东西;
三:最后在你的当前用户里c盘下C:\Documents and Settings\All Users\Application Data\找到mysql的目录,删掉,忘了告诉一句;
那是隐藏文件,先改变文件夹设置就行!
相关文档:
手动建表:
CREATE TABLE `excel` (
`id` int(11) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`passwd` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=gb2312; 注意是gb2312
然后在连接数据库时加上:
useUnicode=true&characterEncoding=gb2312.
就ok啦! ......
I found a solution to anyone else who may be having this problem.
First start mysql using skip grant tables
root@ns1 [/var/lib/mysql/mysql]# service mysql start --skip-grant-tables
Starting MySQL [ OK ]
now with mysql started, you can repair the mysql/user table
root@ns1 [/var/lib/mysql ......
一个简单示例--
1,准备:MySQL数据库驱动包【mysql-connector-java-5.1.10-bin.jar】导入
2,创建测试连接主程序
package mysqlConnection;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class JdbcDemo {
public static void main(String[] args) {
......
解决方法(转):---但执行第一种办法时出现错误,第二种办法成功
1。改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -pvmwaremysql>use mysql;mysql>update use ......