Why can't I use slow_query_log on MySQL 5.6 on CentOS 6.4?
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
...
## Logging
## *** THESE LOGS WORK JUST FINE ***
log_error = /var/log/mysql/error.log
general_log_file = /var/log/mysql/mysql.log
general_log = 1
## *** THESE LOGS BREAK MYSQL ***
#log_slow_queries = /var/log/mysql/slow.log
#long_query_time = 5
#log-queries-not-using-indexes
Here's the /var/log/mysql directory:
$ ls -lh
total 100K
-rw-r----- 1 mysql root 47K Nov 22 06:02 error.log
-rw-rw---- 1 mysql root 42K Nov 22 06:05 mysql.log
-rw-rw---- 1 mysql mysql 0 Nov 22 06:01 slow.log
If I uncomment the log_slow_query lines in the /etc/my.cnf I receive the following error:
$ /etc/init.d/mysql restart
Shutting down MySQL.. SUCCESS!
Starting MySQL..... ERROR! The server quit without updating PID file (/var/lib/mysql/server.domain.com.pid).
What am I missing?
Looks like MySQL changed the format. Now it's slow_query_log not log_slow_queries.
This works:
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 5
Related
OS: RHEL 8.5
mysql version : 8.0.26
Zabbix version : 5.0
Problem : Cannot connect to the database
Jan 27 14:00:23 zabbix zabbix_server[26357]: Got signal [signal:15(SIGTERM),sender_pid:26520,sender_uid:0,reason:0]. Exiting ...
Jan 27 14:00:23 zabbix zabbix_server[26377]: syncing history data in progress...
Jan 27 14:00:23 zabbix zabbix_server[26377]: syncing history data done
Jan 27 14:00:23 zabbix zabbix_server[26397]: [Z3005] query failed: [2006] MySQL server has gone away [select a.alertid,a.mediatypeid,a.sendto,a.subject,a.message,a.status,a.retries,e.source,e.object,e.objectid,a.parameters,a.eventid,a.p_eventid from alerts a left join events e on a.eventid=e.eventid where alerttype=0 and a.status=3 order by a.alertid]
Jan 27 14:00:23 zabbix zabbix_server[26397]: [Z3001] connection to database 'zabbix-server' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Jan 27 14:00:23 zabbix zabbix_server[26397]: database is down: reconnecting in 10 seconds
Jan 27 14:00:23 zabbix zabbix_server[26357]: [Z3001] connection to database 'zabbix-server' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Jan 27 14:00:23 zabbix zabbix_server[26357]: Cannot connect to the database. Exiting...
Jan 27 14:00:30 zabbix systemd[1]: zabbix-server.service: Can't open PID file /run/zabbix/zabbix_server.pid (yet?) after start: No such file or directory
When i try to execute the command manually
mysql -u zabbix-server -p zabbix-server -S /var/lib/mysql/mysql.sock
It work without problem...
This is my /etc/my.cnf
##
# Ansible managed
#
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[mysqld]
#bind-address=0.0.0.0
bind-address=localhost
max_allowed_packet=64M
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 2802M
#
# 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
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
!includedir /etc/my.cnf.d
I tried every possible solution but nothing seems to work for me:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I'm trying to set up SSL for mysql on my WHM server. I've been following the official cPanel documentation, but am having an issue with it. I've created all the certificates and keys, set the owner to mysql, and added the lines specified to the my.cnf file, but after restarting mysql and running the below command it gives this error:
root#euk-92874 [~]# mysql -e "show variables like '%ssl%';"
ERROR 2026 (HY000): SSL connection error: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca
This is the my.cnf file (I've tried the paths with and without the ' quotes around them):
# This group is read both both by the client and the server
# use it for options that affect everything
#
#[client-server]
#
# include all files from the config directory
#
#!includedir /etc/my.cnf.d
[mysqld]
default-storage-engine=MyISAM
open_files_limit=10000
local-infile=0
datadir=/var/lib/mysql
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
#symbolic-links=0
max_user_connections=200
max_connections=500
interactive_timeout=300
wait_timeout=200
join_buffer_size = 128M
connect_timeout=300
#group_concat_max_len=2;
max-allowed-packet = 32M
max-connect-errors = 1000000
### INNODB
#innodb_buffer_pool_size=1000M
innodb_flush_log_at_trx_commit=1
innodb_file_per_table=1
## You may want to tune the below depending on number of cores and disk sub
innodb_write_io_threads=4
#innodb_io_capacity=20000
#innodb_io_capacity_max=40000
innodb_doublewrite=1
innodb_log_file_size=512M
innodb_log_files_in_group=2
innodb_buffer_pool_instances=2
innodb_thread_concurrency=16
## avoid statistics update when doing e.g show tables
innodb_stats_on_metadata=0
innodb_file_format=barracuda
innodb_flush_method = O_DIRECT
#REPLICATION SPECIFIC _ GENERAL
#server_id must be unique across all mysql servers participating in replication.
#OTHER THINGS, BUFFERS ETC
key_buffer_size = 256M
sort_buffer_size = 512K
read_buffer_size = 4M
read_rnd_buffer_size = 12M
myisam_sort_buffer_size = 64M
skip_name_resolve
table_cache = 750M
query_cache_limit = 30M
query_cache_size = 48M
tmp_table_size = 512M
max_heap_table_size = 256M
memlock=0
sysdate_is_now=1
max_connections=2000
thread_cache_size=256M
query_cache_type = 2
table_open_cache=1024
lower_case_table_names=0
thread_concurrency = 4
max_allowed_packet=268435456
ssl
ssl-cipher=DHE-RSA-AES256-SHA
ssl-ca='/mysql_keys/ca-cert.pem'
ssl-cert='/mysql_keys/server-cert.pem'
ssl-key='/mysql_keys/server-key.pem'
[mysqldump]
quick
max_allowed_packet = 512M
[mysql]
no-auto-rehash
[client]
ssl
ssl-cert='/mysql_keys/client-cert.pem'
ssl-key='/mysql_keys/client-key.pem'
[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqld_safe]
#log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
The certs and keys are in the folder:
root#euk-92265 [~]# ls -la /mysql_keys
total 40
drwxr-xr-x 2 mysql mysql 4096 May 11 09:00 ./
drwxr-xr-x. 23 root root 4096 May 11 09:35 ../
-rw-r--r-- 1 mysql mysql 1472 May 11 08:54 ca-cert.pem
-rw-r--r-- 1 mysql mysql 1679 May 11 08:53 ca-key.pem
-rw-r--r-- 1 mysql mysql 1346 May 11 08:57 client-cert.pem
-rw-r--r-- 1 mysql mysql 1675 May 11 08:57 client-key.pem
-rw-r--r-- 1 mysql mysql 1123 May 11 08:57 client-req.pem
-rw-r--r-- 1 mysql mysql 1346 May 11 08:56 server-cert.pem
-rw-r--r-- 1 mysql mysql 1675 May 11 08:56 server-key.pem
-rw-r--r-- 1 mysql mysql 1155 May 11 08:56 server-req.pem
I would also provide a log but I'm not sure where to find it. Does anyone have any ideas?
Ended up being because both certificates were using the exact same details and were conflicting with each other.
I am getting the following error when trying to start MySQL 5.6 for the first time after installing it with Homebrew on MacOS Mojave.
ERROR! The server quit without updating PID file
I have read the other comments and answers on here and they suggest either setting the ownership of the /mysql dir to the current user (crmpicco) or mysql, but neither of those solutions work for me.
$ ll /usr/local/var/mysql/
total 221264
-rw-r--rwx 1 crmpicco _mysql 56 21 Aug 22:09 auto.cnf
-rw----rwx 1 crmpicco _mysql 1680 21 Aug 22:09 ca-key.pem
-rw-r--rwx 1 crmpicco _mysql 1112 21 Aug 22:09 ca.pem
-rw-r--rwx 1 crmpicco _mysql 1112 21 Aug 22:09 client-cert.pem
-rw----rwx 1 crmpicco _mysql 1676 21 Aug 22:09 client-key.pem
-rw-r--rwx 1 crmpicco _mysql 217 21 Aug 22:17 ib_buffer_pool
-rw-r--rwx 1 crmpicco _mysql 50331648 21 Aug 22:17 ib_logfile0
-rw-r--rwx 1 crmpicco _mysql 50331648 21 Aug 22:09 ib_logfile1
-rw-r--rwx 1 crmpicco _mysql 12582912 21 Aug 22:17 ibdata1
-rw----rwx 1 crmpicco _mysql 1676 21 Aug 22:09 private_key.pem
-rw-r--rwx 1 crmpicco _mysql 452 21 Aug 22:09 public_key.pem
-rw-r--rwx 1 crmpicco _mysql 1112 21 Aug 22:09 server-cert.pem
-rw----rwx 1 crmpicco _mysql 1680 21 Aug 22:09 server-key.pem
CraigRMsMacBook:mysql crmpicco$ mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/var/mysql/CraigRMsMacBook.pid).
Am I missing something in my configuration?
$ mysql --verbose --help | grep my.cnf
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
CraigRMsMacBook:mysql crmpicco$ cat /etc/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# 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
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with
# ticks/quotes escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing
# the socket location.
[client]
port = 3306
#socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions
# are currently parsed.
[mysqld_safe]
#socket = /var/run/mysqld/mysqld.sock
#nice = 0
[mysqld]
#
# * Basic Settings
#
#
# * IMPORTANT
# If you make changesi to these settings and your system uses
# apparmor, you may also need to also adjust
# /etc/apparmor.d/usr.sbin.mysqld.
#
#user = mysql
#socket = /var/run/mysqld/mysqld.sock
port = 3306
#basedir = /usr
#datadir = /var/lib/mysql
#tmpdir = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
#key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
#myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
log_error = /var/log/mysql/error.log
# Here you can see queries with especially long duration
#log_slow_queries = /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
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
# Query Caching
query-cache-type = 1
# Default to InnoDB
default-storage-engine=innodb
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
i installed mysql 5.7 but then found out I need mysql 5.6 so i deleted all mysql related packages with
apt-get remove --purge mysql*
so it gotten removed. then i issued:
apt-get install mysql-server-5.6 mysql-client-5.6
so the mentioned packages gotten installed.
but its not starting using systemctl start mysql or service mysql start or even restart. the result is this:
service mysql restart
or
service mysql start
or
systemctl restart mysql
or
systemctl start mysql
returns:
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
but
systemctl status mysql
returns
mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-04-10 13:24:00 EDT; 29s ago
Docs: man:systemd-sysv-generator(8)
Process: 15820 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
Main PID: 1323 (code=exited, status=0/SUCCESS)
Apr 10 13:23:30 server mysqld[15926]: 2017-04-10 13:23:30 15925 [Note] InnoDB: Compressed tables use zlib 1.2.8
Apr 10 13:23:30 server mysqld[15926]: 2017-04-10 13:23:30 15925 [Note] InnoDB: Using Linux native AIO
Apr 10 13:23:30 server mysqld[15926]: 2017-04-10 13:23:30 15925 [Note] InnoDB: Using CPU crc32 instructions
Apr 10 13:23:30 server mysqld[15926]: 2017-04-10 13:23:30 15925 [Note] InnoDB: Initializing buffer pool, size = 128.0M
Apr 10 13:23:30 server mysqld[15926]: 2017-04-10 13:23:30 15925 [Note] InnoDB: Completed initialization of buffer pool
Apr 10 13:24:00 server mysql[15820]: ...fail!
Apr 10 13:24:00 server systemd[1]: mysql.service: Control process exited, code=exited status=1
Apr 10 13:24:00 server systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Apr 10 13:24:00 server systemd[1]: mysql.service: Unit entered failed state.
Apr 10 13:24:00 server systemd[1]: mysql.service: Failed with result 'exit-code'.
what is Failed to start LSB: Start and stop the mysql database server daemon.
before installing 5.6 the 5.7 version was working fine but now its like this.
the /var/log/mysql/errors.log is empty and these are the /var/log/syslog last lines
Apr 10 13:23:30 server mysqld: 2017-04-10 13:23:30 15925 [Note] InnoDB: Completed initialization of buffer pool
Apr 10 13:23:30 server mysqld_safe: mysqld from pid file /var/lib/mysql/server.pid ended
Apr 10 13:24:00 server /etc/init.d/mysql[16277]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Apr 10 13:24:00 server /etc/init.d/mysql[16277]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Apr 10 13:24:00 server /etc/init.d/mysql[16277]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Apr 10 13:24:00 server /etc/init.d/mysql[16277]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Apr 10 13:24:00 server /etc/init.d/mysql[16277]:
Apr 10 13:24:00 server mysql[15820]: ...fail!
Apr 10 13:24:00 server systemd[1]: mysql.service: Control process exited, code=exited status=1
Apr 10 13:24:00 server systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Apr 10 13:24:00 server systemd[1]: mysql.service: Unit entered failed state.
Apr 10 13:24:00 server systemd[1]: mysql.service: Failed with result 'exit-code'.
output of mysqld_safe
170410 13:33:28 mysqld_safe Logging to syslog.
170410 13:33:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170410 13:33:28 mysqld_safe mysqld from pid file /var/lib/mysql/server.pid ended
and this is my /etc/mysql/my.cnf and there is no /etc/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# 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
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
!includedir /etc/mysql/conf.d/
This problem arrives when your /etc/mysql/mysql.conf.d/mysqld.cnf file is wrongly set. If you recently made changes to this file please revert to the previous one or copy the default one here
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# 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
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
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
#
# 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
#
# * Fine Tuning
#
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP
#max_connections = 100
#table_open_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.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
#expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
Stop mysql service:
sudo service mysql stop
Remove mysql:
sudo apt-get remove mysql
sudo apt-get purge mysql
Then issue a whereis mysql command in terminal and remove all of the locations that command lists using rm -rf command. For example rm -rf /etc/mysql .
Then reinstall the version of mysql you desire. All should work as expected.
Just check if you db has been given the rights to write the logs give it the logs writing rights and this will get resolved .
1)First remove already installed mysql-server using--
sudo apt-get remove --purge mysql-server mysql-client mysql-common
2)Then clean all files
sudo apt-get autoremove
3)Then install mysql-server --
sudo apt-get remove -f mysql-server
4)Start mysql server--
sudo systemctl start mysql
5)Check status of mysql-server--
systemctl status mysql
I installed Ubuntu Server 15.04 and MariaDB 10.0.17 on my server.
When install MariaDB, I can't see password setting page, and install is complete.
So I try to change my root password using SET PASSWORD and UPDATE table.
But, not happened.
I can access MySQL using any password and no password.
Like this:
root#kuroneko-Server:~# mysql -uroot -p
Enter password: [Type 'itsnotpassword']
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 34
Server version: 10.0.17-MariaDB-0ubuntu1 (Ubuntu)
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
I already tring flush privileges; and service mysql restart.
Reinstall ubuntu, reinstall mariadb... etc.
service mysql status:
root#kuroneko-Server:~# service mysql status
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: active (running) since 금 2015-05-22 11:17:41 EDT; 34min ago
Docs: man:systemd-sysv-generator(8)
Process: 8127 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 8158 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/mysql.service
├─8183 /bin/bash /usr/bin/mysqld_safe
├─8184 logger -p daemon.err -t /etc/init.d/mysql -i
└─8338 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
5월 22 11:17:40 kuroneko-Server systemd[1]: Starting LSB: Start and stop the mysql database server daemon...
5월 22 11:17:40 kuroneko-Server mysql[8158]: * Starting MariaDB database server mysqld
5월 22 11:17:41 kuroneko-Server mysql[8158]: ...done.
5월 22 11:17:41 kuroneko-Server systemd[1]: Started LSB: Start and stop the mysql database server daemon.
MariaDB setting.
[mysqld]
#
# * Basic Settings
#
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
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.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
#log_slow_queries = /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
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
#
# * Character sets
#
# Default is Latin1, if you need UTF-8 set all this (also in client section)
#
character-set-server = utf8
collation-server = utf8_general_ci
character_set_server = utf8
collation_server = utf8_general_ci
#
# * Unix socket authentication plugin
#
# Needed so the root database user can authenticate without a password but
# only when running as the unix root user.
#
# Also available for other users if required.
# See https://mariadb.com/kb/en/unix_socket-authentication-plugin/
plugin-load-add = auth_socket.so
Does anyone know about this?
I can't find any information about this problem.
See: http://ubuntuforums.org/showthread.php?t=2275033
And execute the below sql:
USE mysql;
UPDATE user
SET password=PASSWORD('NEW_PASSWORD'),
plugin=''
WHERE user='root';
FLUSH PRIVILEGES;
PS: Because of safe consideration, the plugin field on root users was set, in order to prevent non-root user login. So cancelling that plugin will work.
The answer is right there in your config file
#
# * Unix socket authentication plugin
#
# Needed so the root database user can authenticate without a password but
# only when running as the unix root user.
#
# Also available for other users if required.
# See https://mariadb.com/kb/en/unix_socket-authentication-plugin/
plugin-load-add = auth_socket.so
The auth_socket.so allows when you are the root, to login without password prompt. So you can ideally login with just typing "mysql"
MariaDB 10.0.17 cannot access root with non-root user.
(Includ web access)
And anyone can access MariaDB root with ubuntu root user.
(Not Certification)
So make new root2 user to managed mysql on web.
Unix socket authentication plugin is built-in since 10.0.22-6
Needed so the root database user can authenticate without a password but only when running as the unix root user.
Also available for other users if required.
See https://mariadb.com/kb/en/unix_socket-authentication-plugin/