thaicosmic.com

หนัง

วันอาทิตย์ที่ 12 ธันวาคม พ.ศ. 2564

temp

 sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf

#

# The MySQL database server configuration file.

#

# One can use all long options that the program supports.

# Run program with --help to get a list of available options and with

# --print-defaults to see which it would actually understand and use.

#

# For explanations see

# http://dev.mysql.com/doc/mysql/en/server-system-variables.html


# Here is entries for some specific programs

# The following values assume you have at least 32M ram


[mysqld]

       character-set-server=utf8

       collation-server=utf8_general_ci

#

# * Basic Settings

#

user = mysql

# pid-file = /var/run/mysqld/mysqld.pid

# socket = /var/run/mysqld/mysqld.sock

# port = 3306

# datadir = /var/lib/mysql

# If MySQL is running as a replication slave, this should be

# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir

# tmpdir = /tmp

#

# Instead of skip-networking the default is now to listen only on

# localhost which is more compatible and is not less secure.

bind-address = 0.0.0.0

mysqlx-bind-address = 127.0.0.1

#

# * Fine Tuning

#

key_buffer_size = 16M

# max_allowed_packet = 64M

# thread_stack = 256K


# thread_cache_size       = -1


# This replaces the startup script and checks MyISAM tables if needed

# the first time they are touched

myisam-recover-options  = BACKUP


# max_connections        = 151


# table_open_cache       = 4000


#

# * Logging and Replication

#

# Both location gets rotated by the cronjob.

#

# Log all queries

# Be aware that this log type is a performance killer.

# general_log_file        = /var/log/mysql/query.log

# general_log             = 1

#

# Error log - should be very few entries.

#

log_error = /var/log/mysql/error.log

#

# Here you can see queries with especially long duration

# slow_query_log = 1

# slow_query_log_file = /var/log/mysql/mysql-slow.log

# long_query_time = 2

# log-queries-not-using-indexes

#

# The following can be used as easy to replay backup logs or for replication.

# note: if you are setting up a replication slave, see README.Debian about

#       other settings you may need to change.

# server-id = 1

# log_bin = /var/log/mysql/mysql-bin.log

# binlog_expire_logs_seconds = 2592000

max_binlog_size   = 100M

# binlog_do_db = include_database_name

# binlog_ignore_db = include_database_name

วันศุกร์ที่ 10 ธันวาคม พ.ศ. 2564

mysql8

 https://www.tecmint.com/fix-mysql-error-1819-hy000/

SET GLOBAL validate_password.length=6;

SET GLOBAL validate_password.policy=0;

ALTER USER 'root'@'localhost' IDENTIFIED BY 'Vhere@03301';

CREATE USER 'root'@'%' IDENTIFIED BY 'Vhere@03301';

GRANT CREATE ON *.* TO 'root'@'%';

CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'Vhere@03301';

CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'Vhere@03301';

sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf


GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'Vhere@03301';
FLUSH PRIVILEGES;

=====================================================

sudo apt update

sudo apt install firewalld

sudo systemctl enable firewalld

sudo systemctl start firewalld

sudo firewall-cmd --state

========================================

sudo apt install mate-utils
mate-search-tool
==========================================================
sudo gedit /etc/phpmyadmin/config.inc.php
$cfg['Servers'][$i]['port'] = '3333';
=============================================================
GRANT DROP ON *.* TO 'root'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, ALTER, INDEX on *.* TO 'root'@'localhost';

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, ALTER, INDEX on *.* TO 'root'@'%';

FLUSH PRIVILEGES; 
==========================================================
sudo gedit /etc/apache2/conf-enabled/phpmyadmin.conf
===========================================================
SELECT 
    user, 
    host, 
    Select_priv, 
    Insert_priv,
    Update_priv,
    Delete_priv,
    Create_priv,
    Drop_priv
FROM
    mysql.user;
 
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%';

GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.12';
============================================================
sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf