MYSQL Command Startup Error - mysql

I ran this command:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
from terminal without fully understanding it like a dummy (trying to get mysql server to start automatically on boot) and know I can't access mysql at all.
I get this error:
2016-01-11 17:26:52 551 [ERROR] InnoDB: Unable to lock ./ibdata1,
error: 35
2016-01-11 17:26:52 551 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
Can someone explain what I did?

This issue is not related to the executed command. What you did is creating soft/symbolic links (something like shortcut) to plist files that are used to manage MySQL services. You can simply use unlink command to unlink them (It's not recommended unless you know which file can be unlinked without any side effects).
So your question is answered here.

Related

I am having troubles with Mysql - "about query logging issue"?

i want to save the queries of my mysql to a .out/.log/.txt file on my desktop. I am using a Mac machine. i saw my friend use "tee" linux command in mysql to log the queries like
tee ~/Desktop/mylog.txt
above command worked on his laptop running windows but shows an error-
( Can't create/write to file '~/Desktop/mylog.txt' (Errcode: 2 - No such file or directory)
Error logging to file '~/Desktop/mylog.txt')
on my laptop. Once i tried with no file on my desktop to let it create one, then i pre-created one. but in both cases it was not working.
then i also tried this one below:-
mysqld --log=~/Desktop/myquery.log
this also doest work and gives an error:
mysqld: Can't change dir to '/usr/local/mysql-5.7.18-macos10.12-x86_64/data/' (Errcode: 13 - Permission denied)
2017-09-05T08:35:50.566311Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-09-05T08:35:50.567503Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-09-05T08:35:50.567630Z 0 [Note] mysqld (mysqld 5.7.18) starting as process 25981 ...
2017-09-05T08:35:50.602972Z 0 [Warning] Can't create test file /usr/local/mysql-5.7.18-macos10.12-x86_64/data/Lohitakshs-MacBook-Air.lower-test
2017-09-05T08:35:50.603050Z 0 [Warning] Can't create test file /usr/local/mysql-5.7.18-macos10.12-x86_64/data/Lohitakshs-MacBook-Air.lower-test
2017-09-05T08:35:50.603305Z 0 [ERROR] failed to set datadir to /usr/local/mysql-5.7.18-macos10.12-x86_64/data/
2017-09-05T08:35:50.603328Z 0 [ERROR] Aborting
2017-09-05T08:35:50.606324Z 0 [Note] Binlog end
2017-09-05T08:35:50.608285Z 0 [Note] mysqld: Shutdown complete
Then i also tried by going SUDO , but that also gave the same error.
Now my problem is that i have too many queries on my screen right now, which i cannot afford to loose, so i need a solution which can solve the issue on my running server.
Thanks a lot
The mysql program doesn't understand the ~ shorthand for your home directory.
If you're in your home directory when you run the mysql command, you can simply type
mysql> tee Desktop/mylog.txt
If not, you'll need to type the full path.
mysql> tee /Users/yourusername/Desktop/mylog.txt

The server quit without updating PID file '

I use the command:
/usr/local/Cellar/mysql/5.6.26/support-files/mysql.server start
to start the database and get the error info:
ERROR! The server quit without updating PID file(/usr/local/var/mysql/macbooks-MacBook-Pro.local.pid).
The local.err has the following information:
151103 20:43:37 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2015-11-03 20:43:37 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-03 20:43:37 0 [Note] /usr/local/Cellar/mysql/5.6.26/bin/mysqld (mysqld 5.6.26) starting as process 42772 ...
2015-11-03 20:43:37 42772 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2015-11-03 20:43:37 42772 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/Cellar/mysql/5.6.26/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2015-11-03 20:43:37 42772 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Your MySQL installation appears to be damaged. You have an error but the proposed resolution isn't likely to help:
/usr/local/Cellar/mysql/5.6.26/bin/mysqld: Can't find file: './mysql /plugin.frm'
(errno: 13 - Permission denied)
2015-11-03 20:43:37 42772 [ERROR] Can't open the mysql.plugin table.
Please run mysql_upgrade to create it.
As you see, MySQL cannot open a file, but not because it does not exist; rather because it has no rights to do so (error 13).
From the console, verify the status of the mysql/plugin.frm file in the 'mysql' directory. You'll need to find the MySQL data directory (mysql).
Supposing it's /usr/local/var/mysql/, you would do
ls -la /usr/local/var/mysql/ | more
(SPACE or ENTER to page the output) and see a row containing "plugin.frm".
If there is not, then running the mysql_upgrade command might fix things (but backup the mysql installation and data directory first! Just in case).
If there is, verify it has the same user and group as the other files. Chances are that the other files will be owned by Cellar/users and this, maybe, by root/wheel. As administrator (su), try running
chown Cellar:users ./mysql/plugin.frm
and this should fix the Errno 13, and possibly the PID trouble as well.
Failing everything else, reinstalling MySQL could be a solution. You'll install the same version 5.6.26, then verify the data directory and, if necessary, overwrite it with your backup, having care to preserve the new ownerships and permissions.
This trick isn't guaranteed to work between different MySQL versions and OSes, but on the same machine with the same MySQL version and OS it stands excellent chances.
You can also run a partial restore of only the databases you need (for example you can skip restoring the mysql tablespace where all users and permissions are. You'll lose them, but the data will still be accessible in the other databases).

Building MySQL as non-root and with another MySQL already running

I need to use a bioinformatics tool that uses MySQL. The tool is called SyMap. When I try to run SyMap, it tells me there's a MySQL server already running so I should either shut it down or point SyMap to another server. Since I work on an HPC that allows me limited permissions, I cannot shutdown the MySQL server. So I've been trying to build my own local MySQL server. With zero knowledge about MySQL, this has been frustrating.
I tried to follow this guide to build MySQL as a non-root user with the addition of the flag MYSQL_TCP_PORT=3307 to the cmake command to have the local server run on a different port than the original's (3306). Whenever I get to the step where I have to execute mysql_install_db, it says:
2015-10-31 20:52:02 [WARNING] mysql_install_db is deprecated. Please
consider switching to mysqld --initialize 2015-10-31 20:52:02 [ERROR]
Child process: /home/rajeha/software/mysql/bin/mysqldterminated
prematurely with errno= 32 2015-10-31 20:52:02 [ERROR] Failed to
execute /home/rajeha/software/mysql/bin/mysqld --bootstrap
--datadir=/home/rajeha/software/mysql/data --lc-messages-dir=/usr/share/mysql --lc-messages=en_US
-- server log begin -- 2015-11-01T01:52:02.964453Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead 2015-11-01T01:52:02.969334Z 0 [ERROR] Invalid old_passwords mode: 1.
Valid values are 2 and 0
2015-11-01T01:52:02.969376Z 0 [ERROR] Aborting
-- server log end --
I also tried to run the ./bin/mysqld --initialize --user=mysql command, but I still get the error that old_passwords is equal to 1.
If I try to run the server with mysql_safe, it says:
*./bin/mysqld_safe: line 130: /var/log/mysqld.log: Permission denied ./bin/mysqld_safe: line 164: /var/log/mysqld.log: Permission denied
151031 20:53:12 mysqld_safe mysqld from pid file
/home/rajeha/software/mysql/the.pid ended ./bin/mysqld_safe: line 130:
/var/log/mysqld.log: Permission denied*
This is because it's trying to access /var/log/ which I cannot write onto. I probably have to change the config file that tells mysql to access this directory, and that also specifies the value of old_passwrods, but I don't know where to find it.
I would appreciate your help.
Thanks.

MySQL won't start on XAMPP server

I have a problem with my XAMPP server. I can start Apache, FileZilla, and every thing else without problems, but when I try to start MySQL, it just says
Attempting to start MySQL service...
and it stays like that forever, like if it was frozen or something.
Any ideas how to fix it?
I fetch the problem to start xampp services "mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files"
I delete all area_log files form xampp\mysql\data
after that I restart XAMPP than it works.
Thanks
Check the log files for MySQL. You will find them in this directory:
C:\xampp\mysql\data (assuming standard install location of xampp)
Also check if no other program or service uses the default MySql port.
You can do this by using this command:
netstat -an | findstr "3306"
If anything shows up the default mysql port is in use.
In Windows, you should go: Start > Run > services.msc > Apache 2.4 > Properties > Start Mode > Automatic > Apply > Start > OK > [Same as MySQL]
I was not able to start Mysql on xampp.
Error message was:-
Aria recovery failed. Please run aria_chk -r on all Aria tables and
delete all aria_log.######## files. Plugin 'Aria' init function
returned error. Plugin 'Aria' registration as a STORAGE ENGINE failed.
Plugin 'FEEDBACK' is disabled. Aria engine is not enabled or did not
start. The Aria engine must be enabled to continue as mysqld was
configured with --with-aria-tmp-tables. Aborting.
Just to go xampp/mysql/data and delete or remove the file related to aria_log and restart your xampp server.
Worked fine for me.
Resolve the issue stopping the mysql process in the activity monitor and then restarting the mysql server from within the xampp UI.
Go to the error log and check. For me I got this error message:
InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.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.
So what I did was I went to the mysql folder and deleted the data1idb file. After that it worked fine. The problem started when I installed Drupal.
Perform
which mysql.server
sudo path/to/mysql.server start
This should work on *nix OS
eg sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start for mac osx
In The xampp folder you should find the start mysql batch file. Run it, The firewall might ask if you want to allow it through ( So check your firewall if it lets mysqld.exe through )
OP did not provide enough information, however this (and other errors) can be caused by the default MySQL port (3306) being used. If this is the case, you can solve it like this:Go to: XAMPP Control Panel -> MySQL: "Config" button -> my.ini Change the port number from 3306 to a different valid port number. I just used 3307.You can find out more information about your problem by looking at the error log file. This is found here: XAMPP Control Panel -> MySQL: "Logs" button -> mysql_error.log
Running the "setup_xampp.bat" file located in the root directory of Xampp did the trick for me.
Though this is late, I'm sure it would help someone in future.
First run which mysql.server to know where mysql is located on your machine. After then run sudo /usr/local/bin/mysql.server stopto be sure that no other mysql process is running. If no other process is running, you would definitely get an error saying MySQL server PID file could not be found!. That's fine.
After then run sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start to start Xampp's mysql server. When you go to the Xampp GUI, you should see that mysql status as running.
Please note that this is for OS X users.
I face same issue. I installed xampp in D drive.
I uninstall and install setup as run as administrator. Again face same issue.
I searched and try lot of suggestion but no luck.
I solve the problem by right click on xampp and open as Administrator and xampp start working fine.
I was not able to start MySQL service. When I checked mysql log it said:
[ERROR] mysqld: File 'C:\xampp\mysql\data\aria_log_control' not found (Errcode: 13 "Permission denied")
[ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file 'C:\xampp\mysql\data\aria_log_control'
I checked suggested location in the log and file was present.
I found I was doing silly mistake, Since UAC is activated in my PC, I had to start XAMPP using "Run As Administrator".
It worked fine for me.

mysql cluster - mysqld node failed to connect to mgmt node

I am trying to setup a mysql cluster but was unable to get the mysqld node to connect to the mgmt node.
This is the error I received when I issue the command with -show warnings
C:\Program Files\MySQL\cluster\MySQL_Cluster\My_Cluster>mysqld –defaults-file=c
onf\my.102.cnf.txt -show
120310 2:49:27 [Warning] Can’t create test file C:\Program Files\MySQL\cluster\
ow\des.lower-test
120310 2:49:27 [Warning] Can’t create test file C:\Program Files\MySQL\cluster\
ow\des.lower-test
mysqld: Can’t change dir to ‘C:\Program Files\MySQL\cluster\ow\’ (Errcode: 2)
120310 2:49:28 [ERROR] Aborting
120310 2:49:28 [Note] mysqld: Shutdown complete
I have looked through the web and most answers point to a permission issue. I have setup a "everyone" user group and assigned full control(r/w) to the mysql folder but it still not working. The setup is based on a windows environment.
Does anyone have any ideas to this?
hopefully the windows getting started guide can help:
http://downloads.mysql.com/tutorials/cluster/GetMySQLClusterRunning-Windows.pdf
Dont install mysql in Program Files, install it in C:/mysql/ and that should fix any permission problem
try to start your command prompt with Run as Administrator hope this works.