windows7
1.关闭正在运行的DOS 窗口 转到mysql\bin目录下。
输入mysql --skip-grant-tables回车。如果没有出现提示信息,就对了。
在开一个DOS 窗口 转到mysql\bin目录下。
输入mysql会车 如果成功 将出现提示符 > www.2cto.com?
链接权限数据库>use mysql;
update user set password=password("password") wherer user="root"; #修改密码
> flush privileges; 刷新权限(必须的步骤)
> \q
在my.cnf下添加
[mysql]
loose-default-character-set=utf8
loose-prompt='\u@\h:\p [\d]>'
显示是某个用户登陆
[root@admin ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
表示进入mysql这个库到tables这个表中删除localhost重启下mysql 即可
对mysql上的数据进行查看和更改 语句如下
select * from t_news_list where title like '股份公司部署会计基础工作检查'; 查看数据
update t_news_list set checkup=1,class_id=1,create_time=NOW() where id=3308; 修改查看数据
mysql启动出现错误为 MySQL错误Another MySQL daemon already running with the same unix socket.
则可以使用的命令为 mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
数据出现乱码解决方案是
[root@sx yum.repos.d]# vim /etc/my.cnf
[root@sx yum.repos.d]# more /etc/my.cnf
[mysqld]
character_set_server=utf8
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
mysql 数据库登陆不上 报错中含有libmysqlclient.so.16
1.检查
[root@localhost mysql]# cd /usr/lib64/mysql
查看软连接是否生成
因为问题已解决所以当时出现的软连接问题没有截图
使用相同的服务器系统备份一份/usr/lib64/文件放在有问题的数据库进行解压得到如下结果 重新登陆数据库即可
[root@localhost mysql]# ll
total 11748
lrwxrwxrwx. 1 root root 26 Mar 31 17:46 libmysqlclient_r.so -> libmysqlclient_r.so.16.0.0
lrwxrwxrwx. 1 root root 26 Mar 31 17:46 libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0
-rwxr-xr-x. 1 root root 1598472 May 11 2016 libmysqlclient_r.so.16.0.0
lrwxrwxrwx. 1 root root 24 Mar 31 17:46 libmysqlclient.so -> libmysqlclient.so.16.0.0
lrwxrwxrwx. 1 root root 24 Mar 31 17:46 libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
-rwxr-xr-x. 1 root root 1587936 May 11 2016 libmysqlclient.so.16.0.0
lrwxrwxrwx. 1 root root 14 Mar 31 17:46 libmysqld.so -> libmysqld.so.0
lrwxrwxrwx. 1 root root 18 Mar 31 17:46 libmysqld.so.0 -> libmysqld.so.0.0.1
-rwxr-xr-x. 1 root root 8808272 May 11 2016 libmysqld.so.0.0.1
-rwxr-xr-x. 1 root root 12937 May 11 2016 mysqlbug
-rwxr-xr-x. 1 root root 6399 May 11 2016 mysql_config
drwxr-xr-x. 2 root root 4096 Oct 12 09:36 plug
[root@localhost mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.10 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
完成所有问题
事件语句的使用
CREATE EVENT `周期计划6` ON SCHEDULE EVERY 12 MINUTE STARTS '2017-04-19 13:30:00' ENDS '2017-04-19 15:30:00' ON COMPLETION NOT PRESERVE ENABLE DO CALL voteAddMini12();