화요일, 12월 10, 2024
HomeLinuxUbuntu 16.04 MySQL Install

Ubuntu 16.04 MySQL Install

Ubuntu 16.04 MySQL Install


apt-get update
apt-get install mysql-server mysql-client

mysql_secure_installation
mysql -u root -p

############ mysqli_connect(): Headers and client library minor version mismatch 라는 에러가 발생할 경우
mysql>  GRANT ALL PRIVILEGES ON *.* to 'root'@'%' IDENTIFIED BY 'passwd';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | OFF    |
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.00 sec)

mysql>  SET GLOBAL validate_password_length = 5;
mysql>  SET GLOBAL validate_password_number_count = 0;
mysql>  SET GLOBAL validate_password_mixed_case_count = 0;
mysql>  SET GLOBAL validate_password_special_char_count = 0;

mysql>  GRANT ALL PRIVILEGES ON *.* to 'root'@'%' IDENTIFIED BY 'passwd';
mysql>  FLUSH PRIVILEGES;

########### mysqld.cnf 수정


root@ubuntu: vi /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
### 수정
bind-address           = 0.0.0.0

### UTF8 설정 추가
lower_case_table_names=1

character-set-client-handshake = FALSE
init_connect="SET collation_connection = utf8_general_ci"
init_connect="SET NAMES utf8"
character-set-server = utf8

[client]
default-character-set = utf8
[mysql]
default-character-set = utf8
[mysqldump]
default-character-set = utf8

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular