Moving MySQL data to another drive - mysql

I want to move my data in C:\ProgramData\MySQL\MySQL Server 5.5\data to E:\Mysql5Data
Stopped MySQL5 Service
Changed "datadir" value in my.ini file to E:/Mysql5Data
Started MySQL5 Service
I got 1067 Process terminated unexpectedly error while starting MySQL.
Update:
Logs
160509 13:18:56 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.5\data\DGNLWEBBIP01.lower-test
160509 13:18:56 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.5\data\DGNLWEBBIP01.lower-test
160509 13:18:56 [Note] Plugin 'FEDERATED' is disabled.
160509 13:18:56 InnoDB: The InnoDB memory heap is disabled
160509 13:18:56 InnoDB: Mutexes and rw_locks use Windows interlocked functions
160509 13:18:56 InnoDB: Compressed tables use zlib 1.2.3
160509 13:18:56 InnoDB: Initializing buffer pool, size = 128.0M
160509 13:18:56 InnoDB: Completed initialization of buffer pool
160509 13:18:56 InnoDB: Operating system error number 5 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory. It may also be you have created a subdirectory
InnoDB: of the same name as a data file.
InnoDB: File name .\ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
SOLUTION:
Murray's comment

Related

Error 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)-- MYSQL Command line connectivity

I am trying to run MYSQL Server from command line and I am getting the above error on executing mysql -u root -p command. I tried to rectify the issue following the below mentioned logs but the same error comes again.
LOG DATA:
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqld -nt --standalone --console
150615 0:30:10 [Warning] option 'new': boolean value 't' wasn't recognized. Set
to OFF.
150615 0:30:10 [Note] mysqld (mysqld 5.5.44) starting as process 3768 ...
150615 0:30:10 [Note] Plugin 'FEDERATED' is disabled.
150615 0:30:10 InnoDB: The InnoDB memory heap is disabled
150615 0:30:10 InnoDB: Mutexes and rw_locks use Windows interlocked functions
150615 0:30:10 InnoDB: Compressed tables use zlib 1.2.3
150615 0:30:10 InnoDB: Initializing buffer pool, size = 675.0M
150615 0:30:10 InnoDB: Completed initialization of buffer pool
InnoDB: Error: space header page consists of zero bytes in data file C:\MySQL Da
tafiles\ibdata1
150615 0:30:10 InnoDB: Could not open or create data files.
150615 0:30:10 InnoDB: If you tried to add new data files, and it failed here,
150615 0:30:10 InnoDB: you should now edit innodb_data_file_path in my.cnf back
150615 0:30:10 InnoDB: to what it was, and remove the new ibdata files InnoDB c
reated
150615 0:30:10 InnoDB: in this failed attempt. InnoDB only wrote those files fu
ll of
150615 0:30:10 InnoDB: zeros, but did not yet use them in any way. But be caref
ul: do not
150615 0:30:10 InnoDB: remove old data files which contain your precious data!
150615 0:30:10 [ERROR] Plugin 'InnoDB' init function returned error.
150615 0:30:10 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150615 0:30:10 [ERROR] Unknown/unsupported storage engine: INNODB
150615 0:30:10 [ERROR] Aborting
150615 0:30:10 [Note] mysqld: Shutdown complete
150615 0:30:10 InnoDB: Could not open or create data files.
Run mysqld as admin user. You can use windows command runas to run from console as admin.

Error 1067 for MySQL 5.5 on Windows Server 2008 R2

I had installed MySQL Server 5.5 on Windows Server 2008 R2 before 2 months and it's working till now. But suddenly MySQL Service goes down and I am not able to restart the service.
Error Message:
121120 14:33:31 [Note] Plugin 'FEDERATED' is disabled.
121120 14:33:31 InnoDB: The InnoDB memory heap is disabled
121120 14:33:31 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121120 14:33:31 InnoDB: Compressed tables use zlib 1.2.3
121120 14:33:31 InnoDB: Initializing buffer pool, size = 2.0G
121120 14:33:31 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file .\ib_logfile0 is of different size 0 95420416 bytes
InnoDB: than specified in the .cnf file 0 224395264 bytes!
121120 14:33:31 [ERROR] Plugin 'InnoDB' init function returned error.
121120 14:33:31 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121120 14:33:31 [ERROR] Unknown/unsupported storage engine: INNODB
121120 14:33:31 [ERROR] Aborting
121120 14:33:31 [Note] C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld: Shutdown complete
How can I resolve this issue?
This is the error:
InnoDB: Error: log file .\ib_logfile0 is of different size 0 95420416 bytes
InnoDB: than specified in the .cnf file 0 224395264 bytes!
What you can do is search for that .cnf file and change the bytes from 224395264 to 95420416
Mayby that helps....
UPDATE
as mentiod here: Change InnoDB Log File Size
Can you delete the log file ( .\ib_logfile0 ) when the server isn't running, and then the problem souldn't be there anymore...

Can't initiate mysql in MAC OS X 10.7.5

I installed MySQL through a package located in MySQL site.
I changed this directory:
/usr/local/mysql-5.5.28-osx10.5-x86/data
For _mysql
However, when I try to do mysqld start, I get the following errors and warnings:
121018 18:04:17 [Warning] Can't create test file /usr/local/mysql-5.5.28-osx10.5-x86/data/homer.lower-test
121018 18:04:17 [Warning] Can't create test file /usr/local/mysql-5.5.28-osx10.5-x86/data/homer.lower-test
121018 18:04:17 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
121018 18:04:17 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
121018 18:04:17 InnoDB: The InnoDB memory heap is disabled
121018 18:04:17 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
121018 18:04:17 InnoDB: Compressed tables use zlib 1.2.3
121018 18:04:17 InnoDB: Initializing buffer pool, size = 128.0M
121018 18:04:17 InnoDB: Completed initialization of buffer pool
121018 18:04:17 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
Any tips on what can be happening?
The easiest thing to do is to install the System Preferences plugin that you get with the download and start/stop MySQL using that. You can set it there to start automatically when the system restarts.

mysql : InnoDB: Cannot continue operation

I have installed mysql on windows 7 environment.
When I attempt to start the server from command line
as: mysqld --user=root
I get following message:
120914 15:47:04 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.5\data\SFO1502128830A.lower-test
120914 15:47:04 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.5\data\SFO1502128830A.lower-test
120914 15:47:04 [Note] Plugin 'FEDERATED' is disabled.
120914 15:47:04 InnoDB: The InnoDB memory heap is disabled
120914 15:47:04 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120914 15:47:04 InnoDB: Compressed tables use zlib 1.2.3
120914 15:47:04 InnoDB: Initializing buffer pool, size = 128.0M
120914 15:47:04 InnoDB: Completed initialization of buffer pool
120914 15:47:04 InnoDB: Operating system error number 5 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory. It may also be you have created a subdirectory
InnoDB: of the same name as a data file.
InnoDB: File name .\ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
Please advice,
Thanks,
Try this:
Run Windows CMD Prompt as an Administrator and execute your MySql command.

MySQL 5.5.9 Wont Start

I installed mysql version 5.5.9 on my mac and I tried to start it using this command :
sudo /usr/local/mysql/support-files/mysql.server start
mysql didn't start with this command. I checked the localhost.err file in data directory and it was like this :
110227 22:51:14 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
110227 22:51:14 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
110227 22:51:14 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
110227 22:51:14 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110227 22:51:14 InnoDB: The InnoDB memory heap is disabled
110227 22:51:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110227 22:51:14 InnoDB: Compressed tables use zlib 1.2.3
110227 22:51:14 InnoDB: Initializing buffer pool, size = 128.0M
110227 22:51:14 InnoDB: Completed initialization of buffer pool
110227 22:51:14 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
110227 22:51:14 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
110227 22:51:15 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!
110227 22:51:15 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...
110227 22:51:15 InnoDB: Waiting for the background threads to start
110227 22:51:16 InnoDB: 1.1.5 started; log sequence number 1595916
110227 22:51:16 [ERROR] /usr/local/mysql/bin/mysqld: unknown option '--skip-locking'
110227 22:51:16 [ERROR] Aborting
110227 22:51:16 InnoDB: Starting shutdown...
110227 22:51:16 InnoDB: Shutdown completed; log sequence number 1595916
110227 22:51:16 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
110227 22:51:16 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.pid ended
I deleted the two ib_log files, I changed my.cnf file and I got nothing.
--skip-locking was removed in MySQL 5.5. See here.
Edit your my.cnf file and change "skip-locking" to "skip-external-locking".
I had this same issue on mac, I have other MySQL instances installed from MAMP and XAMP.
Do a locate in terminal: locate my.cnf
Take note of any other my.cnf files not located in your AMPPS directory.
I found that when i removed /private/etc/my.cnf, MySQL started with no issues.
sudo mv /private/etc/my.cnf /private/etc/my-old.cnf
1 ) in the terminal , launch command : mysql_upgrade ( to create the tables that are non existent )
2 ) edit /etc/my.cnf , comment out the --skip-locking statement
that's all , happy SQLing