create database if not exists weibo default character set utf8; GRANT ALL PRIVILEGES ON `weibo`.* TO 'weibo'@'%' IDENTIFIED BY '3c38f920d8bf11c96c09023fe49c8917'; GRANT ALL PRIVILEGES ON `weibo`.* TO 'weibo'@'localhost' IDENTIFIED BY '3c38f920d8bf11c96c09023fe49c8917'; SET old_passwords = 0; UPDATE mysql.user SET Password = PASSWORD('3c38f920d8bf11c96c09023fe49c8917') WHERE User = 'weibo' limit 1; SELECT LENGTH(Password) FROM mysql.user WHERE User = 'weibo'; FLUSH PRIVILEGES;
测试
mysql -uweibo -p3c38f920d8bf11c96c09023fe49c8917
windows
1 2 3 4
mysqld --romve 删除mysql服务 mysqld --install 安装mysql服务 mysqld --initialize 一定要初始化 net start mysql 启动服务