Error in docker-compose's mariadb when i restart it [duplicate] - mysql

I configured 3 drives on my machine: 1 for data files, 1 for transaction logs files, and 1 for temporary files.
I would like to initialize MariaDB at its first run straight after yum installation. Here are my steps:
created /etc/my.cnf with the following parameters
[mysqld]
aria-log-dir-path=/tempdb/mysql/
datadir=/data/mysql/
tmpdir=/tempdb/mysql/
innodb_data_home_dir=/data/mysql/
innodb_log_group_home_dir=/tlogs/mysql/
innodb_undo_directory=/tlogs/mysql/
aria-log-dir-path=/tempdb/mysql/
install MariaDB
sudo yum -y update
sudo tee /etc/yum.repos.d/MariaDB.repo<<EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
sudo yum makecache fast
sudo yum -y install MariaDB-server MariaDB-client
sudo systemctl start mariadb
I get the following exception
Can't start server : Bind on unix socket: No such file or directory
Can anyone shed some light on what I'm doing wrong? is this the right procedure to achieve my goal?
Thx
Gianluca

need to set the socket parameter
[client]
socket=/tmp/mysql.sock
...
[mysqld]
...
socket=/tmp/mysql.sock
...

Related

How can I reset MySQL Community Server to default setting in Ubuntu 22.04?

the result of the command journalctl -xeu mysql.servicePlease help I am running Ubuntu 22.04
I had MySQL running perfectly before I installed MariaDB for a project and after I uninstalled MariaDB and installed MySQL but the server won't start.
The first Error I got when I type mysql in the terminal
"ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)" in 5 steps How can I fix this MySQL error on Ubuntu 22.04?
I tried to fix this by deleting the mariaDB files I found in the mysqld directory and editing the file mysqld.sock with the following informations
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
socket=/var/run/mysqld/mysqld.sock
[client]
socket=/var/run/mysqld/mysqld.sock
How do I completely uninstall and restore the MySQL server.
I tried to fix this by deleting the mariaDB files I found in the mysqld directory and editing the file mysqld.sock with the following informations
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
socket=/var/run/mysqld/mysqld.sock
[client]
socket=/var/run/mysqld/mysqld.sock
This didn't work and I tried to uninstall and install mysql with the following command.
sudo apt remove --purge mysql-server mysql-client
sudo apt autoremove
sudo apt autoclean
sudo apt install mysql-server
now I got the message during installation.
MySQL has been frozen to prevent damage to your system. Please see /etc/mysql/FROZEN for help.
Then I ran this set of commands:
service mysql start
systemctl unmask mysql.service
service mysql start
journalctl -xeu mysql.service
sudo less /var/log/mysql/error.log
I tried to check the error log but there is no error log file
How do I completely uninstall and restore the MySQL server.
I have been able to solve the problem using these two lines of command
sudo apt remove --purge mysql-\*
sudo apt install mysql-server mysql-client
After this, I continued with the MySQL setup and it was a good as new

Error in docker-compose's MariaDB when it is restarted [duplicate]

I configured 3 drives on my machine: 1 for data files, 1 for transaction logs files, and 1 for temporary files.
I would like to initialize MariaDB at its first run straight after yum installation. Here are my steps:
created /etc/my.cnf with the following parameters
[mysqld]
aria-log-dir-path=/tempdb/mysql/
datadir=/data/mysql/
tmpdir=/tempdb/mysql/
innodb_data_home_dir=/data/mysql/
innodb_log_group_home_dir=/tlogs/mysql/
innodb_undo_directory=/tlogs/mysql/
aria-log-dir-path=/tempdb/mysql/
install MariaDB
sudo yum -y update
sudo tee /etc/yum.repos.d/MariaDB.repo<<EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
sudo yum makecache fast
sudo yum -y install MariaDB-server MariaDB-client
sudo systemctl start mariadb
I get the following exception
Can't start server : Bind on unix socket: No such file or directory
Can anyone shed some light on what I'm doing wrong? is this the right procedure to achieve my goal?
Thx
Gianluca
need to set the socket parameter
[client]
socket=/tmp/mysql.sock
...
[mysqld]
...
socket=/tmp/mysql.sock
...

ispmanager mysql settings empty. Edit button is disabled ((

Ispmanager 5, CentOs 7
I just uninstall default Mysql with commands:
service mariadb stop
yum remove mariadb mariadb-server
Than upgraded it with mariadb 10.3:
cat > /etc/yum.repos.d/MariaDB.repo <<EOF
# MariaDB.repo
# MariaDB 10.3 CentOS repository list
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
yum -y install MariaDB-server MariaDB-client
mkdir -p /var/run/mysqld
chown -R mysql:mysql /var/run/mysqld
systemctl enable mariadb
service mariadb start
After this - all things working fine except this:
The server settings - is empty. Edit button is disabled.
PS: /etc/my.cnf is on its place, mysql --help shows than it uses /etc/my.cnf and ~/my.cnf
I edited the parameter to new path
path mysqld usr/sbin/mysqld
in /usr/local/mgr5/etc/ispmgr.conf.d/mysql.conf
Because new version of mariadb uses another path of the mysqld.
After this all things works like a charm )))

Can't connect to local mysql server - error 2002

I have what seems to be a common error, but all of the solutions I've found online aren't working for me.
I've been following a tutorial to display a MySQL table to a website in realtime (found here), and one of the first steps was to edit the MYSQL config file at /etc/mysql/my.cnf
[mysqld]
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log #Or c:/logs/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog-format = row
However, when I inserted this into the config file and restarted the MYSQL server as instructed, the server wouldn't start, throwing me the error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
In hindsight, I should have just taken out the faulty lines of code from my config file, but I instead uninstalled MySQL and MariaDB thinking it was an error on the side of MySQL and reinstalled them. I'll include the lines of code I ran to do this below to ensure I didn't miss anything.
sudo apt remove --purge mysql-server mysql-client mysql-common
sudo apt autoremove
sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
sudo rm -rf /var/lib/mysql*
sudo apt install mysql-server
I then tried restarting the MySQL server with the following:
service mysql restart
/etc/init.d/mysqld restart
sudo systemctl start mysql
AFter this didn't work, I tried deleting all the contents of /var/lib/mysql and running the following line as instructed in another solution to this issue, which also didn't work.
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Even after reinstalling, it appears I am missing the /etc/mysql folder and the my.cnf file. I tried the line below to create it, but it doesn't work:
sudo dpkg-reconfigure mysql-server-5.7
Have I missed a step? Help is definitely appreciated.

Initialize MariaDB 10.4.12 on CentOS 7.7

I configured 3 drives on my machine: 1 for data files, 1 for transaction logs files, and 1 for temporary files.
I would like to initialize MariaDB at its first run straight after yum installation. Here are my steps:
created /etc/my.cnf with the following parameters
[mysqld]
aria-log-dir-path=/tempdb/mysql/
datadir=/data/mysql/
tmpdir=/tempdb/mysql/
innodb_data_home_dir=/data/mysql/
innodb_log_group_home_dir=/tlogs/mysql/
innodb_undo_directory=/tlogs/mysql/
aria-log-dir-path=/tempdb/mysql/
install MariaDB
sudo yum -y update
sudo tee /etc/yum.repos.d/MariaDB.repo<<EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
sudo yum makecache fast
sudo yum -y install MariaDB-server MariaDB-client
sudo systemctl start mariadb
I get the following exception
Can't start server : Bind on unix socket: No such file or directory
Can anyone shed some light on what I'm doing wrong? is this the right procedure to achieve my goal?
Thx
Gianluca
need to set the socket parameter
[client]
socket=/tmp/mysql.sock
...
[mysqld]
...
socket=/tmp/mysql.sock
...