Trouble launching mysql - mysql

I have some trouble using mysql on Ubuntu 12.04. I hope this post is in the right forum (if not, tell me where to move it)
When I run : sudo /etc/init.d/mysql, I get this message
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mysql
start: Job failed to start
When I run mysql -u root status, I get this
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
So I tried to kill the process, so I ran ps aux | grep mysql showing this
1000 3262 0.0 0.0 4388 832 pts/1 S+ 14:05 0:00 grep --color=auto mysqld
And when I run the kill command, I get this :
kill: No such process
When I launch sudo mysqld --verbose
[Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
121122 14:50:24 [ERROR] An old style --language value with language specific part detected: /usr/share/mysql/french/
121122 14:50:24 [ERROR] Use --lc-messages-dir without language specific part instead.
121122 14:50:24 [Note] Plugin 'FEDERATED' is disabled.
121122 14:50:24 InnoDB: The InnoDB memory heap is disabled
121122 14:50:24 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121122 14:50:24 InnoDB: Compressed tables use zlib 1.2.3.4
121122 14:50:24 InnoDB: Initializing buffer pool, size = 128.0M
121122 14:50:24 InnoDB: Completed initialization of buffer pool
121122 14:50:24 InnoDB: highest supported file format is Barracuda.
121122 14:50:24 InnoDB: Waiting for the background threads to start
121122 14:50:25 InnoDB: 1.1.8 started; log sequence number 2289875
121122 14:50:25 [ERROR] mysqld: unknown variable 'default-character-set=utf8'
121122 14:50:25 [ERROR] Aborting
121122 14:50:25 InnoDB: Starting shutdown...
121122 14:50:26 InnoDB: Shutdown completed; log sequence number 2289875
121122 14:50:26 [Note] mysqld: ArrĂȘt du serveur terminĂ©
Could someone please help

With the command "mysql", what you're trying to do is launch the mysql client.
Mysql client must connect to a server.
You should start mysql server, like Jeremy suggested, or using
sudo start mysql
See here for more information
https://askubuntu.com/questions/125686/mysql-fails-to-start-after-upgrade-to-12-04

Related

Cannot start mySQL "mysqld: Too many arguments (first extra is 'start')."

I want to start mysql but this immediately shows up, I don't realy know how to solve it, can you please help me?
I have Ubuntu 14.04
this is what appears in the terminal.
dyphen#dyphen12-GNU:/etc/mysql$ sudo mysqld start
180510 5:55:25 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
180510 5:55:25 [Warning] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.
180510 5:55:25 [Note] mysqld (mysqld 5.5.60-0ubuntu0.14.04.1) starting as process 7158 ...
180510 5:55:25 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
180510 5:55:25 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
180510 5:55:25 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
180510 5:55:25 InnoDB: The InnoDB memory heap is disabled
180510 5:55:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180510 5:55:25 InnoDB: Compressed tables use zlib 1.2.8
180510 5:55:25 InnoDB: Using Linux native AIO
180510 5:55:25 InnoDB: Initializing buffer pool, size = 128.0M
180510 5:55:25 InnoDB: Completed initialization of buffer pool
180510 5:55:25 InnoDB: highest supported file format is Barracuda.
180510 5:55:26 InnoDB: Waiting for the background threads to start
180510 5:55:27 InnoDB: 5.5.60 started; log sequence number 1595675
mysqld: Too many arguments (first extra is 'start').
Use --verbose --help to get a list of available options
180510 5:55:27 [ERROR] Aborting
180510 5:55:27 InnoDB: Starting shutdown...
180510 5:55:28 InnoDB: Shutdown completed; log sequence number 1595675
180510 5:55:28 [Note] mysqld: Shutdown complete
llja is right. I made the same mistake. To start mysqld, simply type
mysqld
If a new problem surface, check /var/log/mysql/error.log for ERROR messages.

mysql - Unable to start mysql

I have this error when MySQL wants to start:
ERROR! The server quit without updating PID file
(/usr/local/mysql/var/VM_98_215_centos.pid)
And its MySQL error log:
170705 12:50:46 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
170705 12:50:46 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.48-log) starting as process 9091 ...
170705 12:50:46 [Note] Plugin 'FEDERATED' is disabled.
170705 12:50:46 InnoDB: The InnoDB memory heap is disabled
170705 12:50:46 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170705 12:50:46 InnoDB: Compressed tables use zlib 1.2.7
170705 12:50:46 InnoDB: Initializing buffer pool, size = 16.0M
170705 12:50:46 InnoDB: Completed initialization of buffer pool
170705 12:50:46 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
170705 12:50:46 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 2437158, file name ./mysql- bin.000030
170705 12:50:46 InnoDB: Waiting for the background threads to start
170705 12:50:47 InnoDB: 5.5.48 started; log sequence number 7592792
170705 12:50:47 [Note] Recovering after a crash using mysql-bin
170705 12:50:47 [ERROR] Error in Log_event::read_log_event(): 'read error', data_len: 75, event_type: 23
170705 12:50:47 [Note] Starting crash recovery...
170705 12:50:47 [Note] Crash recovery finished.
04:50:47 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
key_buffer_size=16777216
read_buffer_size=262144
max_used_connections=0
max_threads=500
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 406149 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x20)[0x75f310]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x359)[0x657d79]
/usr/lib64/libpthread.so.0(+0xf370)[0x7f32eef57370]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
170705 12:50:47 mysqld_safe mysqld from pid file /usr/local/mysql/var/VM_98_215_centos.pid ended
Thank you in advance!
rpm -q centos-release
centos-release-7-3.1611.el7.centos.x86_64

Mariadb start failed in CentOS 7

I am using Mariadb (mysql Ver 15.1 Distrib 5.5.40-MariaDB) in CentOS (CentOS Linux release 7.0.1406). I tried to restart Mariadb.
systemctl start mariadb
Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.
When I checked : /var/log/mysql-error.log as suggested by 'systemctl status mariadb.service'
170523 10:20:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170523 10:20:10 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
170523 10:20:10 [Warning] Changed limits: max_open_files: 1024 max_connections: 214 table_cache: 400
170523 10:20:10 InnoDB: The InnoDB memory heap is disabled
170523 10:20:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170523 10:20:10 InnoDB: Compressed tables use zlib 1.2.7
170523 10:20:10 InnoDB: Using Linux native AIO
170523 10:20:11 InnoDB: Initializing buffer pool, size = 15.6G
170523 10:20:11 InnoDB: Completed initialization of buffer pool
170523 10:20:11 InnoDB: highest supported file format is Barracuda.
170523 10:20:12 InnoDB: Waiting for the background threads to start
170523 10:20:13 Percona XtraDB (http://www.percona.com) 5.5.40-MariaDB-36.1 started; log sequence number 5336723441509
170523 10:20:13 [Note] Plugin 'FEEDBACK' is disabled.
170523 10:20:13 [ERROR] /usr/libexec/mysqld: unknown variable 'extra-lsndir=/var/tmp'
170523 10:20:13 [ERROR] Aborting
170523 10:20:13 InnoDB: Starting shutdown...
170523 10:20:15 InnoDB: Shutdown completed; log sequence number 5336723441509
170523 10:20:15 [Note] /usr/libexec/mysqld: Shutdown complete
170523 10:20:15 mysqld_safe mysqld from pid file /var/lib/mysql/master.compare-prices.repchecker.jp.pid ended
170523 10:21:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170523 10:21:10 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
170523 10:21:10 [Warning] Changed limits: max_open_files: 1024 max_connections: 214 table_cache: 400
170523 10:21:10 InnoDB: The InnoDB memory heap is disabled
170523 10:21:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170523 10:21:10 InnoDB: Compressed tables use zlib 1.2.7
170523 10:21:10 InnoDB: Using Linux native AIO
170523 10:21:10 InnoDB: Initializing buffer pool, size = 15.6G
170523 10:21:11 InnoDB: Completed initialization of buffer pool
170523 10:21:11 InnoDB: highest supported file format is Barracuda.
170523 10:21:12 InnoDB: Waiting for the background threads to start
170523 10:21:13 Percona XtraDB (http://www.percona.com) 5.5.40-MariaDB-36.1 started; log sequence number 5336723441509
170523 10:21:13 [Note] Plugin 'FEEDBACK' is disabled.
170523 10:21:13 [ERROR] /usr/libexec/mysqld: unknown variable 'extra-lsndir=/var/tmp'
170523 10:21:13 [ERROR] Aborting
.
.
.
.
PS: /var/lib/mysql directory is owned by mysql (there is one more directory mysql~ which is empty)
drwxr-xr-x 8 mysql mysql 4096 May 23 11:05 mysql
drwxr-xr-x. 3 mysql mysql 26 Feb 4 2015 mysql~
Please provide some suggestion. How can I restart my mariadb, I have important database under mariadb.
From the last line of error
[ERROR] /usr/libexec/mysqld: unknown variable 'extra-lsndir=/var/tmp'
It is clear that this variable is not known so try to comment it from /etc/my.cnf and try again.
# Point the following paths to different dedicated disks
tmpdir = /var/tmp
extra-lsndir = /var/tmp ------> Comment this line
target-dir=/var/tmp
I hope it will help.

MariaDB/MySQL resource limit was exceeded

I'm trying to connect to MariaDB/Mysql installed on my CentOS 7 and get the following error when trying to connect using: mysql -u root -p.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
I have tried connecting to it by specifying the IP Address instead of using localhost but I get the same error.
When I try to get the MariaDB status, I get the following message (/bin/systemctl status mariadb.service):
mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: failed (Result: resources)
And starting it yields the following error (/bin/systemctl start mariadb.service):
Job for mariadb.service failed because a configured resource limit was exceeded. See "systemctl status mariadb.service" and "journalctl -xe" for details.
I also looked into the logs located at /var/log/mariadb/mariadb.log
160408 12:21:00 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
160408 16:11:01 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160408 16:11:01 [Note] /usr/libexec/mysqld (mysqld 5.5.47-MariaDB) starting as process 3054 ...
160408 16:11:02 InnoDB: The InnoDB memory heap is disabled
160408 16:11:02 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160408 16:11:02 InnoDB: Compressed tables use zlib 1.2.7
160408 16:11:02 InnoDB: Using Linux native AIO
160408 16:11:02 InnoDB: Initializing buffer pool, size = 128.0M
160408 16:11:02 InnoDB: Completed initialization of buffer pool
160408 16:11:02 InnoDB: highest supported file format is Barracuda.
160408 16:11:04 InnoDB: Waiting for the background threads to start
160408 16:11:05 Percona XtraDB (http://www.percona.com) 5.5.46-MariaDB-37.6 started; log sequence number 54018416776
160408 16:11:06 [Note] Plugin 'FEEDBACK' is disabled.
160408 16:11:07 [Note] Server socket created on IP: '0.0.0.0'.
160408 16:11:07 [Note] Event Scheduler: Loaded 0 events
160408 16:11:07 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.47-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
160409 6:26:06 InnoDB: Error: Write to file ./ibdata1 failed at offset 9 615514112.
InnoDB: 1048576 bytes should have been written, only 585728 were written.
InnoDB: Operating system error number 28.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 28 means 'No space left on device'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
160409 6:26:06 InnoDB: Assertion failure in thread 140463216400128 in file os0file.c line 4377
Anyone has any ideas on how to fix this error?
Thank you :)
> perror 28
OS error code 28: No space left on device
Need I say more?

XAMPP: MySQL does not start after crash

There are aready several questions regarding that MySQL fails to start when running XAMPP, but unfortunately I couldn't figure out a solution from these.
Here is my case:
I installed XAMPP for Linux 5.6.14-3 and when I ran it yesterday everything worked fine.
Today, I ran XAMPP again:
/opt/lampp$ sudo ./xampp start
Starting XAMPP for Linux 5.6.14-3...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
Then I open localhost in the browser bringing me to the xampp dashboard. There I click on the phpMyAdmin menu entry, which gives me:
Error
MySQL said:
Cannot connect: invalid settings.
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server,
and the server rejected the connection.
You should check the host, username and password
in your configuration and make sure that they
correspond to the information given by the
administrator of the MySQL server.
I think that I made sure that the control user has the right pass.
The problem rather seems to be that MySQL does not really start although it says 'ok' (see above). Since, when I stop XAMPP, I get:
/opt/lampp$ sudo ./xampp stop
Stopping XAMPP for Linux 5.6.14-3...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...not running.
XAMPP: Stopping ProFTPD...ok.
Looking at the error_log of xampp, there is a single entry, which looks suspicious (though I don't really understand it), saying:
[Sun Nov 15 11:38:59.737875 2015] [mpm_prefork:notice] [pid 6217] AH00169: caught SIGTERM, shutting down
So, if anybody is able to locate the problem or give me hints for a fix, I would really apreciate. Thanks already!
Edit - problem "fixed" (without knowing, what I've really done, though)
Here's the MySQL error-log (located at /opt/lampp/var/mysql/[computername].err):
2015-11-15 15:52:44 10864 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/
2015-11-15 15:52:44 140410457307008 [Note] Using unique option prefix 'key_buffer' is error-prone and can break in the future. Please use the full name 'key_buffer_size' instead.
2015-11-15 15:52:44 140410457307008 [Note] /opt/lampp/sbin/mysqld (mysqld 10.1.8-MariaDB) starting as process 11011 ...
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Memory barrier is not used
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Using CPU crc32 instructions
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Completed initialization of buffer pool
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: The log sequence numbers 3813213 and 3813213 in ibdata files do not match the log sequence number 9929741 in the ib_logfiles!
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Database was not shutdown normally!
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Starting crash recovery.
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-11-15 15:52:44 140410457307008 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace bitnami_joomla/jos_content_frontpage uses space ID: 14 at filepath: ./bitnami_joomla/jos_content_frontpage.ibd. Cannot open tablespace phpmyadmin/pma__bookmark which uses space ID: 14 at filepath: ./phpmyadmin/pma__bookmark.ibd
2015-11-15 15:52:44 7fb3db6e3780 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./phpmyadmin/pma__bookmark.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
2015-11-15 15:52:44 10864 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/[computername].pid ended
First try: I made a backup of the directory /opt/lampp/var/mysql/phpmyadmin/ and added
innodb_force_recovery = 1
at the end of /opt/lampp/etc/my.conf. That gave me still the same error when starting MySQL again.
Next try was removing the file pma__bookmarks.idb from the directory, which had the effect that the error now complained about pma__favorites instead.
Finally, I removed all pma__*.idb-files and voila! MySQL is running, and I can access the phpMyAdmin-pages.
Works for me, though I don't know what was lost be removing the pma-databases? (They were not restored in any way, as it seems...)
Probably, the database-files were corrupted, when my computer went down, and they were still running!?
You must check whether mysqld process exist in top and then either try to connect with mysql command line client or review MySQL Error log. Sometimes xampp may be confused by MySQL Server which e.g. comes pre-installed with OS.