2

MySQL8.0

 3 years ago
source link: https://www.jansora.com/notes/301
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Ubuntu 20.04 下表名大小写敏感的问题

show variables like '%case%';

lower_case_file_system	OFF
lower_case_table_names	0

解决方法:

  1. 修改 /etc/mysql/mysql.conf.d/mysqld.cnf 新增一行 lower_case_table_names=1

Please go to below location and add the following code

location - cd /etc/mysql/mysql.conf.d/

then sudo vim mysqld.cnf

next, add below under the [mysqld]

lower_case_table_names=1

安装 MySQL

Ubuntu 18.04

下载镜像源

[[wget https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb]]

安装MySQL 8.0镜像源

dpkg -i mysql-apt-config_0.8.15-1_all.deb

会弹出一个界面, 请在界面中选中要安装的是 MySQL 8.0 !!!

更新镜像源

sudo apt update

安装 MySQL 8.0

如果你之前安装过其他版本的MySQL, 那么在安装 MySQL8.0 的前会自动卸载掉其他版本, 请注意保存数据

sudo apt install mysql-server

配置远程访问

打开MySQL命令行

mysql

root@jansora-Vostro-3669:~# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.22-0ubuntu0.20.04.3 (Ubuntu)

Copyright (c) 2000, 2020, 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> 
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, 1 row affected (0.12 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.04 sec)

mysql> ALTER USER 'root'@'%'  IDENTIFIED WITH mysql_native_password BY 'password';
Query OK, 0 rows affected (0.06 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.04 sec)

配置远程访问

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
Query OK, 0 rows affected (0.14 sec)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK