Ok I have a mess of a problem. MySQL was installed on my machine (mac) already but I could not login via terminal (fairly new machine, to me). I had already been working with a couple databases via a SequelPro and decided to login via terminal for a couple jobs.
I couldn't and couldn't figure out why not. I ran brew install mysql and to my surprise it installed mysql. When logging in via terminal I was taken to this instance of MySQL that did not have my databases. Now, I restart SequelPro and it now logs into the new instance vs the one that has my data.
Any idea where I can find my databases and get them to use this new instance? Or any thoughts on how to clean things up in general?
---update---
The DB is InnoDB
/usr/local/bin/mysql
/usr/local/Cellar/mysql
/usr/local/Cellar/mysql/5.6.25/bin/mysql
/usr/local/Cellar/mysql/5.6.25/include/mysql
/usr/local/Cellar/mysql/5.6.25/include/mysql/mysql
/usr/local/Cellar/mysql/5.6.25/share/doc/mysql
/usr/local/Cellar/mysql/5.6.25/share/mysql
/usr/local/include/mysql
/usr/local/Library/LinkedKegs/mysql
/usr/local/opt/mysql
/usr/local/share/doc/mysql
/usr/local/share/mysql
/usr/local/var/mysql
/usr/local/var/mysql/mysql
/usr/local/var/mysql is where my databases from the first instance are. /Cellar is where homebrew installed MySQL. I got a recommendation in the comments to add a symlink...not sure which folder I should use as source or target in this case.
Also, not sure how I would start the database from the old location either.
Any help is most appreciated!
Short script to get the old db running:
GO to the working database data location
Go up one directory
Shutdown any mysqld.
mv database_directory database_directory.backup
Symlink the data directory of any other mysql:
ln -s old_data_directory database_directory
Related
I am using macOS Sierra 10.12.2, MAMP 3.0.7.3.
I have been using MAMP with the MySQL it comes with for a while but I need to run something (Magento 2) that requires a higher version of MySQL than the version MAMP comes with, and I don't want to upgrade that instance of MySQL that comes with MAMP. So I am trying to install a different instance of MySQL for use on this project. I still want to use MAMP's Apache server with PHP to run the project though. I also still want to be able to switch back to the other instance of MySQL.
I am essentially trying to follow this tutorial, but I also want to install phpMyAdmin: http://www.human-element.com/installing-magento2-on-mac-for-local-development/
I have installed MySQL 5.6.35 to /usr/local/mysql/bin
The MAMP MySQL is at /Applications/MAMP/Library/bin/mysql
/Applications/MAMP/Library/bin/mysql --version is 5.5.38
mysql --version is 5.6.35
It seems to be installed correctly but I want to use phpMyAdmin for it, which is where I am having trouble. I downloaded phpMyAdmin 4.6.6 and installed it to /Applications/MAMP/htdocs/phpMyAdmin-4.6.6 (as I still need MAMP to run it). But it seems to be linking with the MAMP instance of MySQL and not the new instance of MySQL. I can only log in with credentials for the MAMP MySQL users and I see all my MAMP databases.
If I go to localhost/phpMyAdmin-4.6.6/setup I think the setup must be wrong but I'm not sure how to specify the other MySQL instance:
I tried changing the server socket path to /tmp/mysql.sock too - this had no noticeable effect.
I also have some symbolic links set up, although I admit I don't really understand what this is for...
cd /var/mysql/
# This one was set up before when I was just using MAMP:
mysql.sock -> /Applications/MAMP/tmp/mysql/mysql.sock
# This is the equivalent I set up (removing above one) for the new instance, but not sure if correct:
mysql.sock -> /tmp/mysql.sock
I've tried switching between both but it doesn't seem to have any effect on phpMyAdmin.
Can someone explain how I link the new version of phpMyAdmin with the new instance of MySQL?
Since you're essentially trying to run two MySQL instances at the same time, you have to make sure they're not using the same socket and TCP/IP port. These things are configured in the MySQL configuration file. I suggest not messing with the MAMP installed version, so edit the one you installed and make sure the port and socket path are different. Also make sure your data directory is different; you can't use the same datadir for two MySQL instances at the same time, and certainly not changing between versions, either. Once you have that sorted out, you can configure phpMyAdmin to connect to them both (you can define more than one server, based on port, hostname, and/or socket).
I have recently broken my gitlab when I've decided to change mysql port to allow external connection.
After that, I was trying to restart my server with "sudo /etc/init.d mysql restart", but finally I wasn't able to restart the server, returning [FAIL] at every try.
I have readen that I could backup the files ibdata, ibadata1, ib_logfile0, ib_logfile1,
/var/lib/mysql and help mysql to restart.
After a long time searching, I finally figure it out. to start/stop a service, the command was
"sudo service mysql start|top".
Unfortunnatly, I lose my database i don't know how, and know all my gitlab projects are down, is there a way to restore a working database ?
On a fresh install of MySQL on Mavericks (via Homebrew if that matters) how can I take database files from a back up and migrate them to /usr/local/var/mysql in the new instance? I have a directory for each database and one huge ibdata1 file.
If I move them by a simple file transfer, start the new instance and log in, each database is there however no data is present when I check a table.
it should work if keeping or upgrading server version. Make sure ownership and permissions are correct. Then run mysql_upgrade which will adjust the files.
Please don't post this question as duplicate. I am trying to configure mysql for about 3 weeks now. Someone should really help me.
I recently installed MySQL 5.1 in a Lenovo laptop to do my project. The laptop is running on Windows 8.
The installation was fine but when I tried to configure MySQL it worked till the last page.
There am getting Error Nr 2003.
I tried it through the command prompt, through services in the control panel. But the problem is that the mysql service is not starting at all. Why it is not starting ? What will be blocking it from starting ?
First you need to start mysql service it is the problem for this above
error.
In case you cant start mysql service means you need to install mysql service.
Steps for install mysql service
Step 1: open command prompt and go to the mysql installed location (for example c:\Program Fiels\MYSQL\Mysql Server5.0\bin\)
Step 2: mysql --install
Step 3: start mysql service using the command NET START MYSQL command
then connect mysql using username and password.
Assuming the service is already running and you still get this error connecting to the localhost using the mysql client, then make sure you have an entry for "localhost" in your hosts file. This was the case I experienced.
I resolved this situation following the following process. After adding the MySQL path to the environment, I kept invoking the program and then checking Event Viewer in the Application Log for MySQL errors that referenced old commands in the ini file. After removing them, what was hanging me up was that the installer was looking for errmsg.sys in a folder that didn't exist, \bin\share. Those folders DO exist, but on the same level, not nested. So I added the folder share to bin and copied errmsg.sys from share to the new nested share, and it worked.
Now that its running, I intend to redo a proper configuration using the workbench, just to gets my ducks in a row.
hth
Go to Run type services.msc. Check whether MySQL services is running or not. If not, start it manually. Once it started, type mysqlshow to test the service.
I've been trying to use my mysql noinstall zip archive and the steps that I found in some of the websites are not descriptive. Can someone help?
If you follow the instruction here you will be alright. From that page:
Users who are installing from the noinstall package can use the instructions in this section to manually install MySQL. The process for installing MySQL from a Zip archive is as follows:
Extract the archive to the desired install directory
Create an option file
Choose a MySQL server type
Start the MySQL server
Secure the default user accounts
To start the sever run
mysqld --console
and after that run
mysql -u root
to start doing whatever you want.
Notice that MySql will function exactly the same as if you would have installed or configured it to run as a service. Your schema's are stored on disk. If you start it after you've stopped it your previous data will still be there. So it doesn't turn magically into an in-memory database.
If you want to install the MySQL database as a service you can use the command below.
mysqld.exe --install