Mysql database not showing up localhost phpmyadmin (sequel pro) - mysql

I'm doing some local wordpress development, I run everything directly from my machine (don't use MAMP or XAMPP). I'm at the place where I'm ready to take the site live - searching the internet it seems like the best way to extract the database is to use phpmyadmin. Locally, I use sequel pro to create and manage my databases. I just added phpmyadmin to my localhost and can see 2 of my databases, but not all. Does anyone know why that is? I'm sure there are other ways to accomplish what I'm trying to do (and I'm happy to hear them too) but also curious why some databases are showing up in phpmyadmin while others are not.
thanks :)

It's very likely that the user connecting through phpmyadmin just simply doesn't have the privileges to see the databases. I'm pretty sure (not 100%) that your path to 'go-live' is dump and restore from local to production and this can be achieved using mysqldump to create your backup file to permit you to copy all the local data into your live machine and restore it. I would assume that sequel pro also permits this activity through gui. If you want to do it like the DBAs do, lookup mysqldump in the MySQL documentation and work from the MySQL command line client. Good luck.

Related

Easiest way to have a MySql database to make some queries against a dump file

I have a dump file of a MySql Database (I never worked with MySql, but I am assuming it's similar enough to SQL Server), because I don't want to run my queries in production.
I never created a local environment and I never worked with MySql. I tried to download MySql Workbench, but the GUI is not helping me. In SQL Server I would just connect with localhost and then everything would be fine. It was back then I had a managed PC by my previous organization. I suppose they installed everything to me.
I want to set up it and just go away. It could be in the cloud or locally.

how do i back up a mysql database on my server onto my computer?

I want to delete all the contents on my digitalocean server and start afresh. It's a ruby on rails project, want to make it java.
But I want to keep one of the databases. Is it possible to backup the database onto my computer? I would have thought it would be straight forward but I've been googling a while with no luck.
The closest I can find is mysql 'dumping' it into another part of the server like :
mysqldump -u username -p database_to_backup > backup_name.sql
And then restoring it somewhere else on the server. But I want to put it on my computer and then delete all the stuff on my server.
The best method would be to install PHPmyadmin and then dump the database into a .sql file, for importing later, Digital Ocean have a guide on their website about installing, and securing it.
This will also make managing the database later, much easier.
Here

Importing a 12gb MySQL database into PHPmyAdmin

SO guys, we had legacy website that has a 12GB MySQL database. We decided to port the legacy website to WordPress and need to import the database into PHPmyAdmin without breaking the database and to implement this in the shortest possible time (although time is not such a critical matter if this can be done painlessly but correctly). So would appreciate if someone can guide me in the right direction and provide detailed instructions.
Thanks guys.
I dont know much but i can recommend to back up you're files befored doing any transfers. If you have a fast internet speed then you guys can try to download the SQL database as a compressed file and dump it into the wordpress new database. The database for mysql should be in your cpanel folder (since all cpanel folders/designs are different it would be best to look up "where to find the msql database on hosting company name's cpanel" and once you find it then you can transfer it whereever is possible)
This is the easiest and most correct way.
mysql -u username -p "dbname" < "path/to/bigdata.sql"
If you have FTP/SSH access, then this is the most probable way.
Upload your .sql via FTP
If you have access to CLI , just run the command above
Normally , this will be fast, but since its 12GB, it might take 30min-1hour depending on server resources.
You can also use other options like this one .
I've already experienced importing 61GB before with just this one-liner.

Connecting my MySQL databases to phpMyAdmin

I am running Mac OS 10.10.2. I have recently been educating myself about php and SQL in order to create an online database application for my employer. However, I have been unable to load up my MySQL databases in phpMyAdmin. I have tried following some advice from this forum, but no answers seem to solve my issue.
I installed MySQLWorkbench (Ver. 6.2.4.12437) as well as XAMPP (Ver. 5.6.3-0), and was using phpMyAdmin to have a play around and better understand what I was getting myself into. I then found one of those follow-the-bouncing-ball type teaching websites which advised me to download and install the MySQL community server (Currently running Ver. 5.6.23)
As instructed, I was learning SQL commands through Terminal and built up some databases/tables this way. I decided I wanted to jump into phpMyAdmin where I felt it'd be easier to continue my work. At first XAMPP was unable to turn on the servers which I overcame by uninstalling and reinstalling. Then I was getting a #2002 error when trying to access phpMyAdmin. I tinkered with config files and put in details relating to my localhost MySQL server (Or at least I assume as much).
I was able to get back into phpMyAdmin finally, but my databases made through terminal are not there.
phpMyAdmin shows: cdcol (the example database), information_schema, mysql, performance_schema, phpmyadmin, and test.
If I open terminal and punch in 'mysql' then 'SHOW DATABASES;' it only lists: information_schema.
If I open terminal and punch in 'mysql' with username 'root' and my password, then 'SHOW DATABASES;' it lists: information_schema, mysql, performance_schema, my tutorial/learning database, and my business database. I dropped the test database from here. THESE are what I want to bring up in phpMyAdmin.
I can only guess that I haven't got it configured properly to access this last mysql server, but I can't determine where I am going wrong. If anyone can shed some light on this, that'd be greatly appreciated.
It appears as if you have two MySQL instances; one from the XAMPP and also the MySQL Community Server that you installed yourself.
The "M" of XAMPP is for MySQL, so yes usually it runs its own MySQL server instance. That's sort of the point of the packaged kit, so you don't have to worry about having any of your own applications installed. In theory it should be no problem to stop the XAMPP MySQL instance and instead use your other one, but may require tweaking some configuration files and is probably not supported. If you can make it work, I don't see a reason why it would be a problem, though.
My suggestion is to either use the complete XAMPP stack or roll your own installation rather than mix and match.

MySql move databases, new installation OSX Mavericks

Recently I made a clean install of OS X Mavericks, and right now i have setup ok mysql,phpmyadmin and apacheserver is running without problems.
PhpMyadmin as i was sure it will be, has no databases.
The databases are located in another disk installation from MountainLion that i was running before.
I understand that i can login PhpMyAdmin and export those databases in .sql one by one but there are a LOT,so i was wondering if there is a faster method to access the files and move to the Mavericks disk.
I remember in another installation i was digging around and i found those databases in the disk but my problem was that they were directories and not just .sql files to copy/paste, and i think that i had permissions problems
By that time they were not many so i prefered to use standard method, export from phpMyAdmin and then import again in the other OSX installation.
I have root access for sql.
Basically everything is the same/carbon as the old installation of MountainLion (username,password etc) so i was wondering if i can copy/paste somehow method.
If permissions needs to be set correctly please advise.
Try out MySQL Workbench for exporting and importing databases:
Workbench
Features
You can connect to one database and fetch data directly from another.
Allthough DannyThunder answer can help a lot other users (and i will choose it as correct) i will go with what most of the devs suggest, to use mysqldump. Problem was that i thought i will not have access to old sql that is why i had to copy/paste somehow the folders, i have backup allready and i am in mavericks and currently restoring.
Backup (from another OS,server etc): mysqldump -u username -p -–all-databases > file.sql
Restore (to the new OS,server) : mysql -u username -p < file.sql
The others have given several good alternatives (I tend to use mysqldump as well), but I'll just point out that phpMyAdmin has no problem exporting multiple databases. Not sure why you think you have to do them one-by-one, but from the main page click Export; by default all databases are selected, you can use the "Custom - display all possible options" radio button to select certain databases only.