System:Ubuntu 18.04.5 LTS
MYSQL: 5.7.31
Tried following commands all shows the same error
systemctl start mysql
/etc/init.d/mysql start
service mysql start
journalctl -xe shows following
Sep 19 05:38:32 www systemd[1]: Starting MySQL Community Server...
Sep 19 05:38:32 www mysql-systemd-start[2938]: ERROR: Unable to start MySQL server:
**Sep 19 05:38:32 www mysql-systemd-start[2938]: /usr/share/mysql/mysql-systemd-start: line 44: mysqld: command not found**
Sep 19 05:38:32 www mysql-systemd-start[2938]: Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.
Sep 19 05:38:32 www mysql-systemd-start[2938]: Once the problem is resolved, restart the service.
Sep 19 05:38:32 www systemd[1]: mysql.service: Control process exited, code=exited status=1 Sep 19 05:38:32 www systemd[1]: mysql.service: Failed with result 'exit-code'.
Sep 19 05:38:32 www systemd[1]: Failed to start MySQL Community Server. Sep 19 05:38:32 www systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Sep 19 05:38:32 www systemd[1]: mysql.service: Scheduled restart job, restart counter is at 1.
Sep 19 05:38:32 www systemd[1]: Stopped MySQL Community Server.
I've highlighted the line that I think is creating a problem
$PATH is
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
/usrs/bin content related to mysql
-rwxr-xr-x 1 root root 4027496 Jul 20 10:50 myisamchk
-rwxr-xr-x 1 root root 3916200 Jul 20 10:50 myisam_ftdump
-rwxr-xr-x 1 root root 3894296 Jul 20 10:50 myisamlog
-rwxr-xr-x 1 root root 3945448 Jul 20 10:50 myisampack
-rwxr-xr-x 1 root root 3608840 Jul 20 10:50 my_print_defaults
-rwxr-xr-x 1 root root 3908456 Jul 20 10:50 mysql
-rwxr-xr-x 1 root root 3799752 Jul 20 10:50 mysqladmin
lrwxrwxrwx 1 root root 10 Jul 20 10:50 mysqlanalyze -> mysqlcheck
-rwxr-xr-x 1 root root 4068280 Jul 20 10:50 mysqlbinlog
-rwxr-xr-x 1 root root 3825320 Jul 20 10:50 mysqlcheck
-rwxr-xr-x 1 root root 5350 Jul 20 10:50 mysql_config
-rwxr-xr-x 1 root root 3627200 Jul 20 10:50 mysql_config_editor
-rwxr-xr-x 1 root root 26952 Jul 20 10:50 mysqld_multi
-rwxr-xr-x 1 root root 27790 Jul 20 10:50 mysqld_safe
-rwxr-xr-x 1 root root 3875176 Jul 20 10:50 mysqldump
-rwxr-xr-x 1 root root 7865 Jul 20 10:50 mysqldumpslow
-rwxr-xr-x 1 root root 22627736 Jul 20 10:50 mysql_embedded
-rwxr-xr-x 1 root root 3791912 Jul 20 10:50 mysqlimport
-rwxr-xr-x 1 root root 5224224 Jul 20 10:50 mysql_install_db
lrwxrwxrwx 1 root root 10 Jul 20 10:50 mysqloptimize -> mysqlcheck
-rwxr-xr-x 1 root root 3616952 Jul 20 10:50 mysql_plugin
-rwxr-xr-x 1 root root 4286152 Jul 20 10:50 mysqlpump
lrwxrwxrwx 1 root root 10 Jul 20 10:50 mysqlrepair -> mysqlcheck
-rwxr-xr-x 1 root root 39016 Jan 12 2018 mysqlreport
-rwxr-xr-x 1 root root 3788520 Jul 20 10:50 mysql_secure_installation
-rwxr-xr-x 1 root root 3790504 Jul 20 10:50 mysqlshow
-rwxr-xr-x 1 root root 3809512 Jul 20 10:50 mysqlslap
-rwxr-xr-x 1 root root 3653288 Jul 20 10:50 mysql_ssl_rsa_setup
-rwxr-xr-x 1 root root 3569976 Jul 20 10:50 mysql_tzinfo_to_sql
-rwxr-xr-x 1 root root 4446416 Jul 20 10:50 mysql_upgrade
Any idea what's wrong? What to do?
I uninstalled all the mysql packages with apt-get remove one by one and then reinstalled them again. I did not delete /var/lib/mysql directory where all data were there. After re-installation everything worked fine and data are also safe. All tables and sites working. I am not sure but i think last package upgrade caused this.
Related
I have installed the MySQL-Server with homebrew before on another User on my Macbook Pro, but I must change the User and now I can't start the MySQL server:
$ mysql.server start
Starting MySQL
./usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 144:
/usr/local/var/mysql/Stefans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 144:
/usr/local/var/mysql/Stefans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 198:
/usr/local/var/mysql/Stefans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 144:
/usr/local/var/mysql/Stefans-MacBook-Pro.local.err: Permission denied
ERROR! The server quit without updating PID file
(/usr/local/var/mysql/Stefans-MacBook-Pro.local.pid).
The User "Stefan" doesn't exist anymore. Maybe the rights on /usr/local/var/mysql are not correct, but I am unsure about what I can do to fix it.
The rights are:
$ sudo ls -lah /usr/local/var/mysql/
Password:
total 221392
drwxr-xr-x 20 501 admin 640B 25 Apr 15:47 .
drwxrwxr-x 8 501 admin 256B 20 Apr 10:12 ..
-rw-r----- 1 501 admin 60K 25 Apr 15:47 Stefans-MacBook-Pro.local.err
-rw-r----- 1 501 admin 56B 20 Apr 10:12 auto.cnf
-rw------- 1 501 admin 1,6K 20 Apr 10:12 ca-key.pem
-rw-r--r-- 1 501 admin 1,1K 20 Apr 10:12 ca.pem
-rw-r--r-- 1 501 admin 1,1K 20 Apr 10:12 client-cert.pem
-rw------- 1 501 admin 1,6K 20 Apr 10:12 client-key.pem
-rw-r----- 1 501 admin 464B 25 Apr 15:47 ib_buffer_pool
-rw-r----- 1 501 admin 48M 25 Apr 15:47 ib_logfile0
-rw-r----- 1 501 admin 48M 20 Apr 10:12 ib_logfile1
-rw-r----- 1 501 admin 12M 25 Apr 15:47 ibdata1
drwxr-x--- 77 501 admin 2,4K 20 Apr 10:12 mysql
drwxr-x--- 90 501 admin 2,8K 20 Apr 10:12 performance_schema
-rw------- 1 501 admin 1,6K 20 Apr 10:12 private_key.pem
-rw-r--r-- 1 501 admin 452B 20 Apr 10:12 public_key.pem
-rw-r--r-- 1 501 admin 1,1K 20 Apr 10:12 server-cert.pem
-rw------- 1 501 admin 1,6K 20 Apr 10:12 server-key.pem
drwxr-x--- 108 501 admin 3,4K 20 Apr 10:12 sys
drwxr-x--- 25 501 admin 800B 20 Apr 12:00 textspinner
I have also tried to reinstall MySQL server but it doesn't work.
How can I fix this?
Ok, with this post i could fix this:
https://coderwall.com/p/os6woq/uninstall-all-those-broken-versions-of-mysql-and-re-install-it-with-brew-on-mac-mavericks
I've seen similar questions being asked on stack overflow but none of them seem to solve my issue properly. I have recently upgraded my system from Ubuntu 16.04 to Ubuntu 17.10 . Since then, I've been experiencing a problem with mysql where I'm not able to start it up properly and it shows the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)
I've searched for many solutions online and as a last effort also tried uninstalling and reinstalling but the problem resurfaces after a few days or few attempts. Upon running "service mysql start", it shows:
Job for mysql.service failed because the control process exited with
error code.
See "systemctl status mysql.service" and "journalctl -xe" for
details.
Upon running the suggested commands it shows the following logs:
systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor
preset: enabled)
Active: activating (start-post) (Result: exit-code) since Thu 2018-
02-22 09:06:31 IST; 4s ago
Process: 8936 ExecStart=/usr/sbin/mysqld (code=exited,
status=1/FAILURE)
Process: 8930 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
(code=exited, status=0/SUCCESS)
Main PID: 8936 (code=exited, status=1/FAILURE); Control PID: 8937
(mysql-systemd-s)
Tasks: 2 (limit: 4915)
CGroup: /system.slice/mysql.service
└─control
├─8937 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─8948 sleep 1
Feb 22 09:06:31 vamshi-Lenovo-G50-70 systemd[1]: Starting MySQL
Community Server...
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:31.948822Z 0 [Warning] Changed limits: max_open_files: 1024
(requested 5000)
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:31.948879Z 0 [Warning] Changed limits: table_open_cache: 431
(requested 2000)
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.126417Z 0 [Warning] TIMESTAMP with implicit DEFAULT value
is deprecated. Please use --explicit_def
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.128149Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-
0ubuntu0.17.10.1) starting as process 8936 ...
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.130652Z 0 [ERROR] Could not open file
'/var/log/mysql/error.log' for error logging: No such file o
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.130675Z 0 [ERROR] Aborting
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.130694Z 0 [Note] Binlog end
Feb 22 09:06:32 vamshi-Lenovo-G50-70 mysqld[8936]: 2018-02-
22T03:36:32.130750Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
Feb 22 09:06:32 vamshi-Lenovo-G50-70 systemd[1]: mysql.service: Main
process exited, code=exited, status=1/FAILURE
journalctl -xe
Feb 22 09:11:21 vamshi-Lenovo-G50-70 gnome-shell[2902]:
[AppIndicatorSupport-WARN] Attempting to re-register
:1.69/org/ayatana/NotificationItem/multiload; resetting inst
Feb 22 09:11:21 vamshi-Lenovo-G50-70 gnome-shell[2902]:
[AppIndicatorSupport-WARN] Item
:1.69/org/ayatana/NotificationItem/multiload is already registered
ESCOD
Every time this happens, I uninstall mysql and reinstall(server not client), and then it works alright for the first few attempts, then it goes back to same situation. Thanks in advance!
ls -al
total 32824
drwxrwxr-x 8 root syslog 4096 Feb 22 08:44 .
drwxr-xr-x 14 root root 4096 Feb 16 2017 ..
-rw-r--r-- 1 root root 1527 Feb 17 08:58 alternatives.log
-rw-r----- 1 root adm 0 Feb 22 08:44 apport.log
-rw-r----- 1 root adm 486 Feb 21 07:29 apport.log.1
-rw-r----- 1 root adm 455 Feb 20 20:54 apport.log.2.gz
-rw-r----- 1 root adm 514 Feb 19 21:42 apport.log.3.gz
-rw-r----- 1 root adm 758 Feb 19 18:15 apport.log.4.gz
-rw-r----- 1 root adm 459 Feb 17 23:07 apport.log.5.gz
-rw-r----- 1 root adm 1389 Feb 16 00:33 apport.log.6.gz
-rw-r----- 1 root adm 275 Feb 14 20:16 apport.log.7.gz
drwxr-xr-x 2 root root 4096 Feb 17 08:55 apt
-rw-r----- 1 syslog adm 86558 Feb 22 09:17 auth.log
-rw-r----- 1 syslog adm 97522 Feb 18 18:02 auth.log.1
-rw------- 1 root utmp 0 Feb 14 20:17 btmp
drwxr-x--- 2 root lp 4096 Feb 22 08:44 cups
drwxr-xr-x 2 root root 4096 Feb 5 14:51 dist-upgrade
-rw-r--r-- 1 root root 30036 Feb 17 08:58 dpkg.log
drwx--x--x 2 root gdm 4096 Feb 14 20:18 gdm3
-rw-r--r-- 1 root root 2136 Feb 22 08:39 gpu-manager.log
-rw-r----- 1 syslog adm 3745433 Feb 22 09:28 kern.log
-rw-r----- 1 syslog adm 2302923 Feb 18 18:07 kern.log.1
-rw-rw-r-- 1 root utmp 0 Feb 14 20:17 lastlog
-rw-r----- 1 syslog adm 657 Feb 22 08:40 mail.log
-rw-r----- 1 syslog adm 1971 Feb 18 15:31 mail.log.1
-rw-r----- 1 syslog adm 3706136 Feb 22 09:28 syslog
-rw-r----- 1 syslog adm 18760212 Feb 22 08:44 syslog.1
-rw-r----- 1 syslog adm 989385 Feb 21 07:07 syslog.2.gz
-rw-r----- 1 syslog adm 587416 Feb 20 09:09 syslog.3.gz
-rw-r----- 1 syslog adm 593456 Feb 19 18:21 syslog.4.gz
-rw-r----- 1 syslog adm 672682 Feb 18 18:07 syslog.5.gz
-rw-r----- 1 syslog adm 166575 Feb 17 09:09 syslog.6.gz
-rw-r----- 1 syslog adm 891827 Feb 16 00:44 syslog.7.gz
-rw-r----- 1 syslog adm 572158 Feb 22 09:28 ufw.log
-rw-r----- 1 syslog adm 234885 Feb 18 18:06 ufw.log.1
drwxr-xr-x 2 root root 4096 Feb 15 22:00 unattended-upgrades
drwxr-xr-x 2 root root 4096 Feb 22 08:40 vmware
-rw-rw-r-- 1 root utmp 20736 Feb 22 08:41 wtmp
Create folder /var/log/mysql and make sure mysqld can write to it.
For some reason, I can't start MySql.
$ sudo /etc/init.d/mysql start
[sudo] password for abigail:
Starting MySQL.............................................[FAILED]................................................................................
What caused this?
This is what in my /var/lib/mysql
$ ll -h /var/lib/mysql
total 1005M
-rw-rw----. 1 mysql mysql 16K Mar 28 11:08 aria_log.00000001
-rw-rw----. 1 mysql mysql 52 Mar 28 11:08 aria_log_control
-rw-rw----. 1 mysql mysql 908M Mar 31 20:10 ibdata1
-rw-rw----. 1 mysql mysql 48M Mar 31 20:09 ib_logfile0
-rw-rw----. 1 mysql mysql 48M Mar 31 20:10 ib_logfile1
-rw-rw----. 1 mysql mysql 5 Mar 28 11:09 localhost.pid
-rw-rw----. 1 mysql mysql 0 Oct 29 23:04 multi-master.info
drwx--x--x. 2 mysql mysql 4.0K Oct 29 23:01 mysql
drwx------. 2 mysql mysql 19 Oct 29 23:01 performance_schema
-rw-rw----. 1 mysql mysql 24K Mar 28 11:09 tc.log
drwx------. 2 mysql mysql 4.0K Nov 3 22:10 test
I think I might have to reinstall mysql.
my.cnf is supposed to be in /etc/my.cnf.
Check the start log for the error message, like in /var/log/mysqld.log.
One of our MySQL servers died but somehow we were able to recover all the files from it. This server was a slave at one time however we stopped it being a slave so we could use it for housekeeping tasks and reports, etc.
Can someone tell me how to recover with this?
I now have these files and a backup of my.cnf
ll /root/home/recovered/mysql/
-rw-r----- 1 root root 117 Jun 1 09:30 rabney-relay-bin.000001
-rw-r----- 1 root root 26 Jun 1 09:30 rabney-relay-bin.index
-rw-r----- 1 root root 113055367168 Jun 1 10:42 ibdata1
-rw-r----- 1 root root 1073741824 Jun 1 09:33 ib_logfile0
-rw-r----- 1 root root 1073741824 Jun 1 09:33 ib_logfile1
drwx------ 2 root root 4096 Jun 1 09:30 mysql
drwx------ 2 root root 16384 Jun 1 09:30 production_copy
-rw-r----- 1 root root 3253518648 Jun 1 09:32 slowquery.log
drwx------ 2 root root 4096 Jun 1 09:30 test
I've been reading articles on Google regarding this but not sure how to do it yet.
I see that have some logs file create by gt.m but just only about mupip rundown or recover information
> root#localhost:/tmp/fis-gtm/V6.2-002_x86_64# ll total 68 drwxrwxrwt 2
> root root 4096 Jul 14 16:22 ./ drwxr-xr-x 3 root root 4096 Jul 13
> 14:32 ../
> -rw-r--r-- 1 root root 0 Jul 13 14:33 root_20150713073215UTC-20150713073319UTC_mupip_rundown
> -rw-r--r-- 1 root root 278 Jul 13 14:32 root_20150713073215UTC_mupip_recover
> -rw-r--r-- 1 root root 0 Jul 14 11:11 root_20150713073407UTC-20150714041129UTC_mupip_rundown
> -rw-r--r-- 1 root root 278 Jul 13 14:34 root_20150713073407UTC_mupip_recover
> -rw-r--r-- 1 root root 278 Jul 14 09:46 root_20150714024647UTC_mupip_recover
> -rw-r--r-- 1 root root 0 Jul 14 09:49 root_20150714024820UTC-20150714024941UTC_mupip_rundown
> -rw-r--r-- 1 root root 278 Jul 14 09:48 root_20150714024820UTC_mupip_recover
> -rw-r--r-- 1 root root 77 Jul 14 09:55 root_20150714025001UTC-20150714025500UTC_mupip_rundown
> -rw-r--r-- 1 root root 291 Jul 14 09:50 root_20150714025001UTC_mupip_recover
> -rw-r--r-- 1 root root 0 Jul 14 10:03 root_20150714030230UTC-20150714030331UTC_mupip_rundown
> -rw-r--r-- 1 root root 311 Jul 14 10:02 root_20150714030230UTC_mupip_recover
> -rw-r--r-- 1 root root 0 Jul 14 14:35 root_20150714030424UTC-20150714073509UTC_mupip_rundown
> -rw-r--r-- 1 root root 260 Jul 14 10:04 root_20150714030424UTC_mupip_recover
Where do I find logs about GTM command like : SET ^,WRIRE....?
Normal commands (Set, Write) are part of the core programming language and are not logged; they are journalled if they read or write something to disk. The question is what are you looking for?