折腾mysql的小坑记录
1.安装
CentOS下先卸载自带的mariadb
rpm -qa | grep mariadb mariadb-libs-5.5.-.el7_2.x86_64
mariadb-5.5.-.el7_2.x86_64
mariadb-server-5.5.-.el7_2.x86_64 rpm -e --nodeps mariadb-libs-5.5.-.el7_2.x86_64
rpm -ivh mysql-community-common-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.-.el6.x86_64.rpm rpm -ivh mysql-community-client-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.-.el6.x86_64.rpm
2.密码修改
# service mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root -pmysql
mysql> UPDATE user SET Password=PASSWORD('welcome1') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
如果出现Unknown column 'password' in 'field list'
修改语句
update mysql.user set authentication_string=password('welcome1') where user='root'
3.建表
mysql> create database mydb;
Query OK, row affected (0.02 sec)
mysql> use mydb;
Database changed
mysql> create table student(stuID char(),stuName char());
Query OK, rows affected (0.08 sec)
mysql>insert into student values('abc','jack');
Query OK, row affected (0.03 sec)
4.远程连接端口,基于命令查看
show global variables like 'port';
修改/etc/my.cnf文件
[root@master ~]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at % of total RAM for dedicated server, else %.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
port=
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links= log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

5.远程连接的权限问题
tomcat端报错

数据库端错误运行授权出错
mysql> grant all privileges on *.* to 'root'@'%' with grant option;
ERROR (HY000): Your password does not satisfy the current policy requirements
Your password does not satisfy the current policy requirements
解决方法:
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> update user set host = '%' where user = 'root';
Query OK, row affected (0.01 sec)
Rows matched: Changed: Warnings: mysql> FLUSH PRIVILEGES;
Query OK, rows affected (0.00 sec)
几经周折,调通收场。明天折腾搬上Kubernetes环境

折腾mysql的小坑记录的更多相关文章
- Win10自带Ubuntu子系统下Mysql安装踩坑记录
linux系统为win10自带Ubuntu子系统 错误的安装过程 我按照一般的方法安装mysql,安装步骤如下 1.升级源 $ sudo apt-get update 2.安装mysql $ sudo ...
- flask 链接mysql数据库 小坑
#config.py MYSQL_NAME = 'root' MYSQL_PASSWORD = 'zyms90bdcs' MYSQL_HOST = 'xxxx' MYSQL_POST = ' MYSQ ...
- jquery事件委托遇到的小坑记录
<script type="text/javascript" src="../../lib/jquery-1.11.2.min.js"></s ...
- CentOS安装时小坑记录
在安装CentOS的时候,由于第一次安装小白,将VM虚拟机的内存设置为512M,导致进行安装的时候无法进入正常的画面安装模式,只能使用简版安装界面,可能对于很多小白不是很熟悉,特此记录,安装CentO ...
- ionic3.x开发小坑记录(一)
自定义font的时候,在assets中创建的文件夹名字别用fonts,会与ionic默认样式冲突,在浏览器中调试是正常的,到手机上就出问题了. 在html中写img的src直接如图 assets前面 ...
- Elasticsearch之match_phrase小坑记录
1.问题抛出 某个词组在Elasitcsearch中的某个document中存在,就一定通过某种匹配方式把它搜出来. 举例: title=公路局正在治理解放大道路面积水问题. 输入关键词:道路,能否搜 ...
- php 小坑记录
1 empty PHP<=5.5不能用于判断一个表达式的执行结果并且netbeans 和eclipse编辑器识别不出来此错误 含有此用法的 类 和页面将会报错 empty($this-> ...
- 复杂业务下向Mysql导入30万条数据代码优化的踩坑记录
从毕业到现在第一次接触到超过30万条数据导入MySQL的场景(有点low),就是在顺丰公司接入我司EMM产品时需要将AD中的员工数据导入MySQL中,因此楼主负责的模块connector就派上了用场. ...
- 微信小程序开发技巧及填坑记录
以下是自己在开发过程中遇到的坑和小技巧,记录以下: 1.出现了 page[pages/XXX/XXX] not found.May be caused by :1. Forgot to add pag ...
随机推荐
- UIResponder简介
1.简介 在使用设备的时候我们大多时候是但手指触摸控件了进行的,比如点击密码按钮解锁,上下浏览网页等动作.你肯定也摇动过iphone抢红包和***等等,我们的系统可以处理这些事件则都需要去使用UIRe ...
- PHP常用函数总结(180多个)
PHP常用函数总结 数学函数 1.abs(): 求绝对值 $abs = abs(-4.2); //4.2 数字绝对值数字 2.ceil(): 进一法取整 echo ceil(9.999); // 10 ...
- Struts2学习笔记01 之 简介及配置
一.Struts简介 * 是轻量级的MVC框架,主要解决了请求分发的问题,重心在控制层和表现层.运用ASOP的思想,使用拦截器来扩展业务控制器 二.使用步骤: 1.引入Sturts2的相关JAR包 2 ...
- Linux安装mysql.8.0.12
1. linux安装mysql8.0.12,亲测可用. 以下是安装过程中出现的问题: 1 [root@localtest1 file]# systemctl start mysqld 2 Job fo ...
- Trapping Rain Water——经典的双边扫描问题
Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...
- [水煮 ASP.NET Web API2 方法论](1-7)CSRF-Cross-Site Request Forgery
问题 通过 CSRF(Cross-Site Request Forgery)防护,保护从 MVC 页面提交到ASP.NET Web API 的数据. 解决方案 ASP.NET 已经加入了 CSRF 防 ...
- 下载Maven安装包
进入Maven官网的下载页面:http://maven.apache.org/download.cgi,如下图所示: 选择当前最新版本:"apache-maven-3.3.9-bin.zip ...
- ubuntu16.04安装最新版本的wine
1.安装源 sudo add-apt-repository ppa:wine/wine-builds sudo apt-get update 2.安装wine sudo apt-get install ...
- react native 问题点
问题点一:安装了react-native-vector-icons后,编译出错 版本: "react": "16.2.0", "react-nativ ...
- sql几种删除语句的联系与区别
DELETE.TRUNCATE.DROP三种删除语句联系与区别 相同点: 1.truncate和不带where子句的delete.以及drop都会删除表内的数据. 2.drop.truncate都是D ...