I'm (re)installing MySQL 5.5.23 on my Mac (Snow Leopard) and since I have two volumes, one with much more space than the boot volume, I'd like to configure it to write all its data to the bigger volume instead of to the boot vol.
I tried moving the data dir to my other volume and using a symlink to it from the installation directory, but I wasn't able to set the ownership of the symlink to the same ownership as the directory originally had ... and MySQL no longer starts. I can't find logs to see what happens when it tries to startup, but I assume it dislikes something about my present arrangement.
Anybody have experience making this work?
ETA: I found this in my macbook.local.err file:
120423 13:01:21 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
120423 13:01:21 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
...
^G/usr/local/mysql/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
120423 14:16:55 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Edit MySQL's my.cnf file so that it's datadir variable (the data directory, usually /var/lib/mysql on Linux machines) is set to a folder of the new volume.
Related
After updating to macOS Catalina I’m not able to run MySQL with MAMP Pro.
I get an error. Here from mysql_error.log
2019-10-09T10:53:16.6NZ mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error.log'.
2019-10-09T10:53:16.6NZ mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql57
2019-10-09T10:53:16.917470Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2019-10-09T10:53:16.919285Z 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.7.26) starting as process 3320 ...
2019-10-09T10:53:16.932570Z 0 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql57/ is case insensitive
2019-10-09T10:53:16.932669Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2019-10-09T10:53:16.932697Z 0 [ERROR] Aborting
2019-10-09T10:53:16.932751Z 0 [Note] Binlog end
2019-10-09T10:53:16.935298Z 0 [Note] /Applications/MAMP/Library/bin/mysqld: Shutdown complete
2019-10-09T10:53:16.6NZ mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
I was searching the interenet and i’ve already tried a lot, but i can’t get it running.
Anyone experienced the same problem and could help?
Thx in advance!
I have a temporary fix, until the developers release a fix. I am using MAMP Pro; I don't know if the interface is the same in non-Pro. The temp fix:
Open MAMP Pro. Stop servers if they are running. Open the MySQL template from the menu: File > Edit Template > MySQL (mysql.cnf) > 5.7.26
Scroll down or find [client]. Beneath [client] add the following line:
user = root
Scroll down or find [mysqld]. Beneath [mysqld] add the following line:
user = root
Start servers.
This worked for me. Hope it helps you.
I had the same problem after installing Catalina on my Mac. First I have tried solution of Les Brown. Did not completely work for me. I got another error:
[Note] Access denied for user 'root'#'localhost' (using password: NO)
After some reading I saw a video on youtube (https://www.youtube.com/watch?v=LKE1G4sinBM) which lets you add the keyword skip-grant-tables in the section mysqld of the MySql template of MAMP-PRO. That let mysql working, but is not the best idea to have forever in your template file. If your try to add the line, do not forget to remove it also!
Last but not least I got the hint of MAMP-Pro-support to make a symbolic link to the mysql.stock. So I executed in Terminal (the '$' is the prompt of terminal).
$ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
Password:...
$
Now everything is working fine.
The answer from Les Brown helped me. I have one addition that may apply to you and others.
If MAMP (PRO) is accessing any directories in Documents or iCloud Drive, Catalina requires the user to approve MAMP's and/or MYSQL's access to that directory.
For instance, on one of my MAMP PRO servers, I run an ETL (using cron) that downloads csv files from a website, then loads data from each downloaded csv into specified MySQL tables in my testing database. The script wouldn't work, however, because MySQL did not have permission to access the downloaded csv files from the Documents directory. I had to run manually my ETL script from the command line. At that point, a MacOS modal popped up directing me to grant permission for MySQL to access Documents. Once I granted that permission, the ETL scripts began working.
I installed MySQL community server 5.7.10 using binary zip. I extracted the zip in c:\mysql and created the data folder in c:\mysql\data. I created the config file as my.ini and placed it in c:\mysql (root folder of extracted zip). Below is the content of the my.ini file
# set basedir to your installation path
basedir=C:\mysql
# set datadir to the location of your data directory
datadir=C:\mysql\data
I'm trying to start MySQL using mysqld --console, but the process is aborted with the below error.
2015-12-29T18:04:01.141930Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2015-12-29T18:04:01.141930Z 0 [ERROR] Aborting
Any help on this will be appreciated.
You have to initialize the data directory by running the following command
mysqld --initialize [with random root password]
mysqld --initialize-insecure [with blank root password]
The mysql_install_db script also needs the datadir parameter:
mysql_install_db --user=root --datadir=$db_datapath
On Maria DB you use the install script mysql_install_db to install and initialize. In my case I use an environment variable for the data path. Not only does mysqld need to know where the data is (specified via commandline), but so does the install script.
mysqld --initialize to initialize the data directory then mysqld &
If you had already launched mysqld& without mysqld --initialize you might have to delete all files in your data directory
You can also modify /etc/my.cnf to add a custom path to your data directory like this :
[mysqld]
...
datadir=/path/to/directory
As suggested above, i had similar issue with mysql-5.7.18, i did this in this way
1. Executed this command from "MYSQL_HOME\bin\mysqld.exe --initialize-insecure"
2. then started "MYSQL_HOME\bin\mysqld.exe"
3. Connect workbench to this localhost:3306 with username 'root'
4. then executed this query "SET PASSWORD FOR 'root'#'localhost' = 'root';"
password was also updated successfully.
I had the same problem. For some reason --initialize did not work.
After about 5 hours of trial and error with different parameters, configs and commands I found out that the problem was caused by the file system.
I wanted to run a database on a large USB HDD drive. Drives larger than 2 TB are GPT partitioned! Here is a bug report with a solution:
https://bugs.mysql.com/bug.php?id=28913
In short words: Add the following line to your my.ini:
innodb_flush_method=normal
I had this problem with mysql 5.7 on Windows.
My problem was caused by an incorrect db restore.
When I dumed the db it also picked up the system mysql tables because I added a space after -p as mentioned here: mysqldump is dumping undesired system tables
Launching the docker instance would work, then I'd restore (and corrupt) the db and it would still keep running, but after restarting it would Exit with error code 1.
The solution was to dump and restore properly without the system tables.
I face the same issue with version Mysql 5.7.33 when the server has rebooted. I fix it by copy other server user files scp /var/lib/mysql/mysql/user.* root#dest:/var/lib/mysql/mysql.
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).
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.
I am using XAMPP and I am trying to access phpMyAdmin through http://localhost/phpmyadmin, but I'm getting this error message:
Error
SQL query:
SHOW PLUGINS
MySQL said:
#1 - Can't create/write to file '/var/folders/_y/gtpc137d1q9gkvsj0dsxjd040000gn/T/#sql9f2_8_0.MYI' (Errcode: 13)
I haven't tried to access it in a while so I don't know what has changed since the last time. Can anyone shed light on this for me? I've Googled and can't seem to understand what most people are talking about in related issues.
Also, my XAMPP won't connect to Apache anymore either (it just keeps giving me the loading image).
Here is the error I'm getting:
121201 22:59:27 mysqld_safe Starting mysqld daemon with databases from /Applications/XAMPP/xamppfiles/var/mysql
Warning: World-writable config file '/Applications/XAMPP/xamppfiles/etc/my.cnf' is ignored
121201 22:59:28 [Warning] Setting lower_case_table_names=2 because file system for /Applications/XAMPP/xamppfiles/var/mysql/ is case insensitive
121201 22:59:28 [Note] Plugin 'FEDERATED' is disabled. /Applications/XAMPP/xamppfiles/sbin/mysqld: Can't create/write to file '/var/folders/_y/gtpc137d1q9gkvsj0dsxjd040000gn/T/ibCVKOvf' (Errcode: 13)
121201 22:59:28 InnoDB: Error: unable to create temporary file; errno: 13
121201 22:59:28 [ERROR] Plugin 'InnoDB' init function returned error.
121201 22:59:28 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121201 22:59:29 [Note] Event Scheduler: Loaded 0 events
121201 22:59:29 [Note] /Applications/XAMPP/xamppfiles/sbin/mysqld: ready for connections.
Version: '5.1.44' socket: '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock' port: 3306 Source distribution
Following line in the log is the reason:
"Warning: World-writable config file
'/Applications/XAMPP/xamppfiles/etc/my.cnf' is ignored"
As Rishi Kalia has pointed out already you have to set the correct permissions:
Open Terminal
Navigate to the XAMPP config folder
cd /Applications/XAMPP/xamppfiles/etc/
Set permissions of my.cnf to 600
sudo chmod 600 my.cnf
Restart MySQL.
I had to reset the permissions in my xampp folder because I needed to be able to INSERT images into a folder in the htdocs, via php from website I am building.
However after I changed the permission I got : Errcode: 13
The process listed above works but I am adding some additional notes for people who have no clue how to use the terminal.
1. Open Terminal
The Terminal is in Applications/Utilities/Terminal
2. Navigate to the XAMPP config folder
pwd shows the path listing to the current directory
cd changes the current directory
ls -a lists all the files in that directory
Enter this code into the terminal:
cd /Applications/XAMPP/xamppfiles/etc/
3. Set permissions of my.cnf to 600
Enter this code into the terminal:
sudo chmod 600 my.cnf
4. Restart MySQL
Voilà!
you have to go to your xampp installation directory and change the permissions of my.cnf to 600
Sometimes you might have installed an application or a server which accesses the same port which is used by XAMPP. Try changing the port for the XAMPP server. Following link will help you.
http://veerasundar.com/blog/2009/07/how-to-change-xampp-server-port/
If you changed the write and read permissions in all the enclosed items inside the XAMPP main folder ("/Applications/XAMPP"), be sure to make this folder Readable and Writable for everyone: "/Applications/XAMPP/xamppfiles/var/mysql".
This can be done accessing to that folder from the Finder and then Get Info (Cmd + I), in the "Sharing & Permissions" click the lock icon, type your password and change "everyone - read only" to "everyone - read & write", and be sure to make that change for all the enclosed items as well (clicking the gear icon and then "Apply to enclosed items...").
Hope this helps!
Pretty simple... once you take ownership of xamppfiles, you also need to update my.cnf file in the xamppfiles/etc/ directory.
Default MySQL password is mysql.
Once you authorized httpd service to run as User yourusername (OS X) Group yourgroup(id).
Open terminal and type in sudo whoami, this will tell you. In the my.cnf file, replace mysql with your user name.
Restart Apache.
Your username.pid file will be automatically updated.
enter in folder etc
excute commande
sudo chmod 600 my.cnf
restart mysql server