sql

mysqld的常用命令:

            2.1、启动mysqld服务:systemctl      start      mysqld

            2.2、关闭mysqld服务:systemctl      stop      mysqld

            2.3、重启mysqld服务:systemctl      restart      mysqld

            2.4、查看mysqld服务:systemctl      status      mysqld

            2.5、设置开机自启动mysqld服务:systemctl      enable      mysqld

            2.6、关闭开机自启动mysqld服务:systemctl      disable      mysqld

 

centos7 mysql命令

service mysql start
service mysql stop
service mysql restart
service mysql status

 

my.cnf

[mysqld]
connect_timeout = 15
wait_timeout = 20
interactive_timeout = 20
innodb_buffer_pool_size = 128M
log_bin

basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
log-error = /var/log/mysql/error.log
pid-file = /var/log/mysql/mysql.pid
port = 3306
server_id = 1
socket = /tmp/mysql.sock

bind-address = 0.0.0.0
join_buffer_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

 

添加 root用户,设置密码相关

Mysql误删root用户解决办法

注释掉 my.cnf中的 skip-grant-tables参数,重启数据库

mysql> use mysql

mysql> select host,user from user;

mysql>insert into user set user='root',ssl_cipher='',x509_issuer='',x509_subject='';
mysql>update user set select_priv='y', insert_priv='y',update_priv='y', Alter_priv='y',delete_priv='y',create_priv='y',drop_priv='y',reload_priv='y',shutdown_priv='y',Process_priv='y',file_priv='y',grant_priv='y',References_priv='y',index_priv='y',create_user_priv='y',show_db_priv='y',super_priv='y',create_tmp_table_priv='y',Lock_tables_priv='y',execute_priv='y',repl_slave_priv='y',repl_client_priv='y',create_view_priv='y',show_view_priv='y',create_routine_priv='y',alter_routine_priv='y',create_user_priv='y',Event_priv='y',Trigger_priv='y',Create_tablespace_priv='y' where user='tarsnode';

使用下列命令重新登陆, 设置root的密码

mysql> mysql -u root;
//mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH';

mysql> update mysql.user set authentication_string=password('lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH') where user='root' and host='localhost';

mysql> flush privileges;
mysql> quit;

 

select host,user,authentication_string from user;
select * from mysql.user where user='tarsnode'\G;
flush privileges;

CREATE USER 'tarsnode'@'localhost' IDENTIFIED BY 'lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH';
ALTER USER 'tarsnode'@'localhost' IDENTIFIED WITH mysql_native_password BY 'lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH';
update user set select_priv='y', insert_priv='y',update_priv='y', Alter_priv='y',delete_priv='y',create_priv='y',drop_priv='y',reload_priv='y',shutdown_priv='y',Process_priv='y',file_priv='y',grant_priv='y',References_priv='y',index_priv='y',create_user_priv='y',show_db_priv='y',super_priv='y',create_tmp_table_priv='y',Lock_tables_priv='y',execute_priv='y',repl_slave_priv='y',repl_client_priv='y',create_view_priv='y',show_view_priv='y',create_routine_priv='y',alter_routine_priv='y',create_user_priv='y',Event_priv='y',Trigger_priv='y',Create_tablespace_priv='y' where user='tarsnode';

 

update user set host='localhost' where user='root';
CREATE USER 'TCvm'@'%' IDENTIFIED BY 'ORf$CZB^YsJ5ylE4*iu&Hl@C^IWYsf5L6*OR$CZB^YsJfaZE@FaCy5LOR$5L1Iu&H';
update user set select_priv='y', insert_priv='y',update_priv='y', Alter_priv='y',delete_priv='y',create_priv='n',drop_priv='n',reload_priv='y',shutdown_priv='n',Process_priv='n',file_priv='n',grant_priv='n',References_priv='n',index_priv='n',create_user_priv='n',show_db_priv='y',super_priv='n',create_tmp_table_priv='n',Lock_tables_priv='n',execute_priv='n',repl_slave_priv='n',repl_client_priv='n',create_view_priv='n',show_view_priv='n',create_routine_priv='n',alter_routine_priv='n',Event_priv='n',Trigger_priv='n',Create_tablespace_priv='n' where user='TCvm';

 

 

lwFaChIQif5L4qOR2cZB3YsJfE5Wy4ujH

 

macOSSierra错误:13 - 权限被拒绝(phpmyadmin site on macOSSierra errno: 13 - Permission denied)

当/ usr / local / mysql文件夹没有足够的权限时,会发生此错误。 您可以使用以下命令更改权限来解决此问题

chmod -R 755 ./mysql

This is error occurs when /usr/local/mysql folder doesn't have not enough permission. You can fix this by changing permissions using the following command

chmod -R 755 ./mysql

 

 

 

MySQL常用指令(备查)

https://www.cnblogs.com/qmfsun/p/4845837.html

https://www.jianshu.com/p/8f8d8161631f

 

//mysql 5.7.34 下载地址

https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.34.tar.gz

 

mysql5.7.9 源码安装 (转)

 

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost

 

进入support-files目录

  1. cp mysql.server /etc/init.d/mysql
  2.  chmod +x /etc/init.d/mysql
  3.  chkconfig --add mysql
  4. chkconfig --list mysql 

/etc/profile - 环境变量 

~/.profile和/etc/profile的区别

解决linux安装编译mysql时出现CMake Error: The source directory “xxx“ does not appear to contain CMakeLists.txt

在mysql中connection设置和wait-timeout的设置

mysql 的一个死锁问题解决,MySQL wait_timeout参数设置

Mysql中的各种timeout

MySQL wait_timeout参数修改

MySQL 配置优化(多个参数)

 

使用wget提示无法建立SSL连接

 

linux下安装cmake

centos 7 安装 cmake1.8 Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the syste

https://blog.csdn.net/Nankys/article/details/107919928

 

 

Centos8 MySQL 官方安装文档

https://dev.mysql.com/doc/refman/8.0/en/installing.html

Centos8编译安装MySQL -----源码安装 

https://blog.csdn.net/weixin_44259371/article/details/107988521

CentOS8编译安装MySQL8发生Could not find rpcgen错误

https://bbs.cnbugs.com/read-39-1.html

 

 

CentOS 8上安装MySQL 8.0 ---------- nice

https://blog.csdn.net/qq_43232506/article/details/102816659

centOS8中安装mysql

http://www.qishunwang.net/news_show_11118.aspx

CentOS8 安装MySql 8.0教程

https://blog.csdn.net/u010900284/article/details/107470236

 

卸载相关

MYSQL8在CentOS8环境的安装方法(DNF/YUM)

https://www.cnblogs.com/lnlidawei/p/14022601.html

yum安装mysql如何卸载_Centos8卸载与安装MySQL5.7

https://blog.csdn.net/weixin_31040783/article/details/113551002

 

Centos8 配置 阿里yum源方法

https://jingyan.baidu.com/article/ff42efa97eec9d809f22021b.html

 

Mac版Mysql8.0.11设置远程访问

https://www.jianshu.com/p/7cb9521f390e

 

 

 

 

MySQL

https://dev.mysql.com/doc/refman/5.7/en/option-files.html

macos 的mysql没有my.cnf 文件,特补充在此

https://blog.csdn.net/tacity/article/details/104440664

Mysql关于my.cnf参数文件的读取顺序及各项配置的覆盖优先级

http://blog.itpub.net/30126024/viewspace-2725156/

mysql之my.cnf详解 ----- nice

https://www.cnblogs.com/panwenbin-logs/p/8360703.html

mysql联合索引

https://www.cnblogs.com/softidea/p/5977860.html

Mysql的联合主键

https://developer.aliyun.com/article/108647

 

MySQL数据库常用命令详解

https://baijiahao.baidu.com/s?id=1604074208356483299&wfr=spider&for=pc

Mysql命令大全

https://www.cnblogs.com/zhangzhu/p/3172486.html

 

Starting MySQL... ERROR! The server quit without updating PID file

------ my.cnf 中有错误 可能中断执行了 (如,mysql 8.0.22 字符集设置错误 )

ERROR! MySQL server PID file could not be found!

https://blog.csdn.net/weixin_45631366/article/details/104261628

 

mysql 重新初始化 

/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql-data

 

Linux - mysql 异常: ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists

https://blog.csdn.net/weixin_30562507/article/details/97471295

 

 

 

------- 正确设置 /usr/local/mysql/data 权限。

------- 删除 /tem/mysql.sock  ----> 报错 mysql.sock正在使用中

------- 提示不能从 /var/lib/mysql/mysql.sock 启动(mysql设置的位置在 /tmp/sock), 是因为与mariadb 冲突了

centos 7 卸载 mariadb 的正确命令

https://blog.csdn.net/dxyzhbb/article/details/109776933?utm_term=centos%E5%AE%8C%E5%85%A8%E5%8D%B8%E8%BD%BDmariadb&utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~all~sobaiduweb~default-4-109776933&spm=3001.4430

CentOS 7.x 卸载删除MariaDB

https://www.cnblogs.com/jiangxiaobo/p/12337026.html

 

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket 解决办法

https://blog.csdn.net/u013631121/article/details/80875837

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '***' (2)

http://aiezu.com/article/45.html

 

关于编译的MySQL的mysql.sock路径

 

 

 

MySQL-8.0.21数据库密码忘了如何解决?

https://www.cnblogs.com/pangwl/p/13685598.html

https://jingyan.baidu.com/article/7082dc1cd9809fe40a89bd22.html

 

ALTER user 'root'@'%' identified with mysql_native_password by '123456';

 

Warning: Using a password on the command line interface can be insecure.

https://www.kancloud.cn/liqingbo27/linux/522565

Warning: Using a password on the command line interface can be insecure.解决办法

https://www.cnblogs.com/sunss/p/6256706.html

 

无法加载caching_sha2_password身份验证插件[已解决]

https://tableplus.com/blog/2018/07/failed-to-load-caching-sha2-password-authentication-plugin-solved.html

解决MAC+ MySQL 8 错误:Authentication plugin 'caching_sha2_password' cannot be loaded

https://www.jianshu.com/p/9a645c473676

 

mysql 8.0.11 中使用 grant ... identified by 时 error 1064 near 'identified by '密码'' at line 1

https://blog.csdn.net/li_0891/article/details/80915780

 

MySQL数据库设置远程访问权限方法

 

 

配置mysql允许远程连接的方法

https://www.cnblogs.com/linjiqin/p/5270938.html

使用Navicat for Mysql连接装在虚拟机Ubuntu16.04上的mysql服务器

https://blog.csdn.net/w410589502/article/details/51767212

 

 

CentOS8.1中使用通用二进制包安装MySQL8.0

https://www.cnblogs.com/xuruiming/p/13053160.html

 

mysql-8.0 下载地址

wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.21-macos10.15-x86_64.tar.gz

//linux

https://dev.mysql.com/downloads/mysql/

wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-8.0.21.tar.gz

 

[有用]MySQL之——安装MySQL报错处理解决方案

https://blog.csdn.net/l1028386804/article/details/105508896

 

CentOS7 下源码安装MySQL 8.0.11

https://blog.51cto.com/snowlai/2140451

 

posted @ 2020-08-13 07:34  javalzy  阅读(94)  评论(0编辑  收藏  举报