查看mysql中数据库或表所占空间的大小目录[TOC]1.计算数据库的总大小修改your_database_name为实际数据库名字即可SELECT table_schema AS `Database`, SUM(data_length + index_length) / 1024 / 1024 AS `Size (MB)` FROM information_schema.tables WHERE table_schema = 'your_datab...
目录[TOC]法1 末尾加\G,即可使行列互换(转置)如select host,user from mysql.user; -> ; +-----------+------------------+ | host | user | +-----------+------------------+ | % | root | | localhost | debian-sys-maint | | localho...
目录[TOC]dropdrop user XXX;删除已存在的用户,默认删除的是'XXX'@'%'这个用户,如果还有其他的用户如'XXX'@'localhost'等,不会一起被删除。如果要删除'XXX'@'localhost',使用drop删除时需要加上host即drop user 'XXX'@'localhost';。deletedelete from user where user='XXX' and host='localhost';其中XXX为用户名,localhost为主机名。区...
还是用docker安装软件比较干净,直接在系统里面安装,想卸载干净都比较难#version: '3.1' services: db: image: mysql:latest container_name: mysql command: --skip-log-bin --default-time-zone=+08:00 # 关闭binlog生成 #command: --log-bin --binlog-expire-logs-auto-purge --b...
删除mysql的数据文件sudo rm /var/lib/mysql/ -R删除mysql的配置文件sudo rm /etc/mysql/ -R(这两步非常重要,百度上很多文章都没有,如果是改完了密码还好,没改重装依然是系统自定账号密码)自动卸载mysql(包括server和client)sudo apt-get autoremove mysql* --purge sudo apt-get remove apparmor(有时候自动卸载并没有卸载完成,我的有一次就就卸载失败了,建议执行两次...
目录[TOC]报错使用Navicat Premium连接mysql时可以连接,但是创建新数据库时报错:1044 - Access denied for user 'root'@'%' to database 'enjoy!!'解决方法可能是因为root没有权限法一:直接修改权限表: root@server:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g...
目录[TOC]问题执行mysql_secure_installation进行初始化时报错:Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER inst...
目录[TOC]问题执行grant all on . to root@’%’ identified by ‘password’ with grant option;时报错:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql&g...
原因:root无权限。use mysql; update user set host='%' where user='root'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';systemctl restart mysql
目录[TOC]1、查看有没有安装MySQLdpkg -l | grep mysql2、 安装MySQLsudo apt install mysql-server如果Debian找不到mysql-server的话,可以尝试sudo apt install default-mysql-server3、检查是否安装成功netstat -tap | grep mysql通过上述命令检查之后,如果看到有 mysql 的socket处于 LISTEN 状态则表示安装成功。
目录[TOC]一、创建数据库1.连接 MySQL输入mysql -u root -p命令,回车,然后输入MySQL的密码(不要忘记了密码),再回车,就连接上MySQL了。mysql -u root -p2.查看当前的数据库使用show databases;查看当前安装的MySQL中有哪些数据库。
目录[TOC]查找数据库路径ps -ef | grep mysql忘记密码my.cnf中添加skip-grant-tables,然后mysqladmin -uroot -p password