Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi there,
I was trying to install mysql in my server. It seems I have installed the package but can't run it. Any suggestion about that?
Code:
[root@genomics mysql]# yum install mysql-community-{client,common,libs}-*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.uprm.edu
* epel: archive.linux.duke.edu
* extras: mirrors.uprm.edu
* updates: mirrors.uprm.edu
Package mysql-community-client-5.7.15-1.el7.x86_64 already installed and latest version
Package mysql-community-common-5.7.15-1.el7.x86_64 already installed and latest version
Package mysql-community-libs-5.7.15-1.el7.x86_64 already installed and latest version
Package mysql-community-libs-compat-5.7.15-1.el7.x86_64 already installed and latest version
Nothing to do
Code:
[root@genomics mysql]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
Code:
[root@genomics mysql]# dpkg --configure mysql
dpkg: error processing mysql (--configure):
no package named `mysql' is installed, cannot configure
Errors were encountered while processing:
mysql
dpkg isn't used on RHEL7 or derivatives such as CentOS7 which appears to be what you're running as indicated by the "el7" portion of the package names it says you have.
yum is relevant and as you saw it ran but said you already have have the packages.
What did you see when you ran the commands it suggested?
"systemctl status mysqld.service" and "journalctl -xe"
By the way adding -l to those commands will keep it from truncating lines in the output.
Also note that you ran "service" but it redirected to "systemctl". RHEL/CentOS went to systemd which uses systemctl starting with RHEL7/CentOS7.
[root@genomics mysql]# yum install mysql-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.uprm.edu
* epel: archive.linux.duke.edu
* extras: mirrors.uprm.edu
* updates: mirrors.uprm.edu
Package mysql-community-server-5.7.15-1.el7.x86_64 already installed and latest version
Nothing to do
Code:
[root@genomics mysql]# systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
Code:
[root@genomics mysql]# systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Fri 2016-09-09 17:48:55 EDT; 14s ago
Process: 28814 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 28790 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Sep 09 17:48:55 genomics systemd[1]: Failed to start MySQL Server.
Sep 09 17:48:55 genomics systemd[1]: Unit mysqld.service entered failed state.
Sep 09 17:48:55 genomics systemd[1]: mysqld.service failed.
Sep 09 17:48:55 genomics systemd[1]: mysqld.service holdoff time over, scheduling restart.
Sep 09 17:48:55 genomics systemd[1]: start request repeated too quickly for mysqld.service
Sep 09 17:48:55 genomics systemd[1]: Failed to start MySQL Server.
Sep 09 17:48:55 genomics systemd[1]: Unit mysqld.service entered failed state.
Sep 09 17:48:55 genomics systemd[1]: mysqld.service failed.
Code:
[root@genomics mysql]# journalctl -xe
Sep 09 17:50:30 genomics sshd[29177]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:31 genomics sshd[29177]: Failed password for root from 182.100.67.62 port 61170 ssh2
Sep 09 17:50:32 genomics unix_chkpwd[29182]: password check failed for user (root)
Sep 09 17:50:32 genomics sshd[29177]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:34 genomics sshd[29177]: Failed password for root from 182.100.67.62 port 61170 ssh2
Sep 09 17:50:35 genomics unix_chkpwd[29183]: password check failed for user (root)
Sep 09 17:50:35 genomics sshd[29177]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:37 genomics sshd[29177]: Failed password for root from 182.100.67.62 port 61170 ssh2
Sep 09 17:50:37 genomics unix_chkpwd[29184]: password check failed for user (root)
Sep 09 17:50:37 genomics sshd[29177]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:39 genomics sshd[29177]: Failed password for root from 182.100.67.62 port 61170 ssh2
Sep 09 17:50:40 genomics unix_chkpwd[29185]: password check failed for user (root)
Sep 09 17:50:40 genomics sshd[29177]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:42 genomics sshd[29177]: Failed password for root from 182.100.67.62 port 61170 ssh2
Sep 09 17:50:42 genomics sshd[29177]: Disconnecting: Too many authentication failures for root [preauth]
Sep 09 17:50:42 genomics sshd[29177]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=182.100.67.62 user=root
Sep 09 17:50:42 genomics sshd[29177]: PAM service(sshd) ignoring max retries; 6 > 3
Sep 09 17:50:45 genomics unix_chkpwd[29188]: password check failed for user (root)
Sep 09 17:50:45 genomics sshd[29186]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=182.100.67.62 user=root
Sep 09 17:50:45 genomics sshd[29186]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:47 genomics sshd[29186]: Failed password for root from 182.100.67.62 port 13906 ssh2
Sep 09 17:50:48 genomics unix_chkpwd[29189]: password check failed for user (root)
Sep 09 17:50:48 genomics sshd[29186]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:50 genomics sshd[29186]: Failed password for root from 182.100.67.62 port 13906 ssh2
Sep 09 17:50:50 genomics unix_chkpwd[29190]: password check failed for user (root)
Sep 09 17:50:50 genomics sshd[29186]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:53 genomics sshd[29186]: Failed password for root from 182.100.67.62 port 13906 ssh2
Sep 09 17:50:54 genomics unix_chkpwd[29191]: password check failed for user (root)
Sep 09 17:50:54 genomics sshd[29186]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:56 genomics sshd[29186]: Failed password for root from 182.100.67.62 port 13906 ssh2
Sep 09 17:50:56 genomics unix_chkpwd[29192]: password check failed for user (root)
Sep 09 17:50:56 genomics sshd[29186]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:50:58 genomics sshd[29186]: Failed password for root from 182.100.67.62 port 13906 ssh2
Sep 09 17:50:59 genomics unix_chkpwd[29201]: password check failed for user (root)
Sep 09 17:50:59 genomics sshd[29186]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Sep 09 17:51:01 genomics sshd[29186]: Failed password for root from 182.100.67.62 port 13906 ssh2
Sep 09 17:51:01 genomics sshd[29186]: Disconnecting: Too many authentication failures for root [preauth]
Sep 09 17:51:01 genomics sshd[29186]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=182.100.67.62 user=root
Sep 09 17:51:01 genomics sshd[29186]: PAM service(sshd) ignoring max retries; 6 > 3
Did you try to start mysql before changing the datadir location?
Why did you change the datadir?
Is /home/zillur/Desktop/zillur/data/mysql/ a valid directory?
Did you move the database files in /var/lib/mysql directory to /home/zillur/Desktop/zillur/data/mysql?
Does the /home/zillur/Desktop/zillur/data/mysql if it exists have the correct permissions?
Did you change selinux to switch from /var/lib/mysql to /home/zillur/Desktop/zillur/data/mysql?
Thank you very much for your comment. I think I have permission problem. How can I give specific permissions.
Code:
[zillur@genomics zillur]$ cd data/
[zillur@genomics data]$ ls
mysql
[zillur@genomics data]$ cd mysql/
[zillur@genomics mysql]$ ls
ls: cannot open directory .: Permission denied
[zillur@genomics mysql]$ sudo ls -l
[sudo] password for zillur:
total 4
drwxrwxrwx. 5 mysql mysql 4096 Sep 1 17:45 mysql
[zillur@genomics mysql]$ sudo ls -alZ
drwxr-x--x. mysql mysql unconfined_u:object_r:user_home_t:s0 .
drwxrwxr-x. zillur zillur unconfined_u:object_r:user_home_t:s0 ..
drwxrwxrwx. mysql mysql system_u:object_r:mysqld_db_t:s0 mysql
[zillur@genomics mysql]$ su
Password:
[root@genomics mysql]# ls
mysql
[root@genomics mysql]# cd mysql/
[root@genomics mysql]# ls
auto.cnf ib_buffer_pool ibdata1 ib_logfile0 ib_logfile1 mysql mysql.sock performance_schema sys
[root@genomics mysql]# cd mysql/
The server mysqld runs as the mysql system user which does not have permissions to access your user home directory /home/zillur. Why do you want to change the datadir?
Thank you very much. This directory has more space. If I don't change the directory the problem is same. If I run mysql as root, still the problem persists. What should I do now? How can I give permission to mysql system user to access /home/zillur or any directory?
Thank you very much for your reply. I can do that. But still I don't have permission to open /var/lib/mysql.
Code:
Last login: Sat Sep 10 17:39:37 2016 from 136.145.182.28
[zillur@genomics ~]$ cd /var/lib/mysql
[zillur@genomics mysql]$ ls
ls: cannot open directory .: Permission denied
[zillur@genomics mysql]$ pwd
/var/lib/mysql
A regular user does not need permissions to access the /var/lib/mysql directory. From your previous posts it seems like the original files still exist.
Change your /etc/my.cnf file so the datadir=/var/lib/mysql and see if mysqld starts.
You might have to delete mysql.sock before it will start.
Thank you very much. I have changed the my.cnf file in /etc.
Code:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[mysqld]
#
# 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 = 128G
#
# 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 = 128000M
sort_buffer_size = 2000M
read_rnd_buffer_size = 2000M
datadir=/var/lib/mysql/
socket=/var/lib/mysql/mysql.sock
explicit_defaults_for_timestamp=1
innodb_force_recovery = 1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Then it asked my user password. After password I got this:
Code:
[zillur@genomics etc]$ systemctl start mysqld
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: Zillur (zillur)
Password:
==== AUTHENTICATION COMPLETE ===
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[zillur@genomics etc]$ systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Sun 2016-09-11 16:19:28 EDT; 13s ago
Process: 9197 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 9172 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Sep 11 16:19:28 genomics systemd[1]: Failed to start MySQL Server.
Sep 11 16:19:28 genomics systemd[1]: Unit mysqld.service entered failed state.
Sep 11 16:19:28 genomics systemd[1]: mysqld.service failed.
Sep 11 16:19:28 genomics systemd[1]: mysqld.service holdoff time over, scheduling restart.
Sep 11 16:19:28 genomics systemd[1]: start request repeated too quickly for mysqld.service
Sep 11 16:19:28 genomics systemd[1]: Failed to start MySQL Server.
Sep 11 16:19:28 genomics systemd[1]: Unit mysqld.service entered failed state.
Sep 11 16:19:28 genomics systemd[1]: mysqld.service failed.
Thanks again. I think I am missing something maybe.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.