phpMyAdmin/MySQL export users/priviledges for later import - php

Is there a way to export priviledges/users out of phpMyAdmin version 3.3.9? And yes, in such format that later those could be imported into a new installation.
It would be good if database relations would be kept and so on.
If phpMyAdmin cannot handle it, MySQL command line solution will work too.
Thanks in advance!

Basically you want to dump some tables from mysql database, like columns_priv,db,tables_priv and user
As far as I remember phpmyadmin have configuration option to hide some databases, but you can access it by typing ?db=mysql in url.

Related

Converting Oracle code to MySQL

If I have a .php file with some Oracle code previously accessing a Oracle DB, but have setup a MySQL DB and want to edit the existing .php file to be compatible with the MySQL DB, how would I go about doing this? Do I have to manually go through each line and search for the equivalent MySQL statement, and if so, is there a library I can access that gives me the Oracle to MySQL equivalent command?
There is this website with a good compilation of tips and tools to help you out on this task: http://www.sqlines.com/oracle-to-mysql

Moving Xamp after formatting my computer and finding all my Databases empty

I recently had to format my computer but I made sure I backed-up all my files before. I am developing lots of local sites using Xamp on my Windows 7 machine.
When I tried to move the files back onto the same drive (c:) and then looked at PHPMYADMIN the tables where there but all empty.
I have all the xamp files including the .frm files but the phpmyadmin shows the DB's but they are all empty i.e showing no tables inside.
Really hope someone can help as I have potentially lost a LOT of work. Thanks in advance.
When you said "I made sure I backed up all my files" -- which files are you talking about? There are the MySQL data files, the XAMPP program files, and then any exported .sql files you may have backed up. The best way to create a backup is to "dump" an SQL file from the database ("Export" from within phpMyAdmin, though I generally use the mysqldump command-line tool). If you didn't do that but still have the MySQL data directory, the links provided by Peter Michael will guide you (although relying on the MySQL data directory isn't generally a good backup means, because of various inconsistencies or loss that can occur with your data; whether it works at all also depends on your table type). I don't know where those data files are stored when using XAMPP and a cursory Google search gives a couple of different options, so good luck.

Why does my MySQL database tables only exist on my Workbench?

I am developing my first php-MySQL system, but have a minimum of database experience. I have successfully created a schema with aproximately 10 tables, and the testings have so far worked fine.
My problems started when i created a dump of the database, as copy for my laptop, so I could continue to test new web pages and new queries even when I am not at home, and still use a localhosted database.
I have successfully imported the dump, and created the schema in my workbench, and it is visible from the command-line prompt "show databases".
However, both my web application, and the command-line prompts are unable to locate the underlying tables. THe problem is at least not directly in my php-code, as it works perfectly on another computer, with another, but assumably identical localhosted database. I have researched the matter online for what feels like a decade, but without any relevant results.
Command-line prompts are able to find tables from every other schema, like the sakila examples. I have tried to compare the two's settings, but they all seem to be identical, for instance they are both InnoDB.
I realise that I am not giving enough information for a direct solution here, but I would greatly appreciate if anyone could hguide me to finding the right questions to ask, so I can solve this matter, and get on with my php-learning.
(SOLVED)
I discovered that the list of open tables had references to an additional Schema. I thereafter realised that I had installed the XAMPP bundle server before I installed MySQL Workbench. In other words, i already had an existing database, with all of the regular examples included in another instance, which were running on port 3306. It also happpened to have an identical, but empty scheme, of the name that I tried to access.
My newly added SQL installation was ported to 3307, and so I am now able to access it. THis issue was just one of several issues I have been able to work around, but they have all been caused by the same mistake. Thanks everyone for trying to help.

Old Mysql to new Mysql?

I was learning some web design about 18+ months ago and got caught up on some other things and had to stop for a while. I'm getting back into web design again. I used xampp back then and using xampp now also. I found my old xampp zip of the entire folder. I extracted it thinking I might get lucky and get my databases back from mysql. I go into the xampp\mysql\data and I copied all the folders with the databases I wanted to put into the new mysql. I loaded up phpmyadmin and the databases are there but they are all empty.
The main database I want to save has these files inside of it...
db.opt
pcms_categories.frm
pcms_meta.frm
pcms_posts.frm
pcms_users.frm
so I see the table files there but mysql isn't loading them. I assume maybe it's an older version and it won't read these files because they are obsolete. I'm not sure. After transferring the files I stopped mysql and reloaded it so just wanted to mention that.
It's been so long ago that it doesn't exactly matter if I can recover this data. I was working on a blog though would be cool to get that back and finish what I started.
try to dump it to .sql perhaps?
in other word, export/import.
First, I'd check for permission issues. MySQL usually requires special permissions on its datafiles. Check to see if MySQL has created its own user/group. Next, I'd try to find out what version of MySQL you previously had, create an installation of said version, and use it to dump the datafiles to SQL.

SQL imports missing tables

I am doing the export from Magento database on one instalation via phpMyAdmin, and I have tried exporting it in .sql and in tar.gz.
When I import that database in another instalation, I get no errors but there are tables missing, so I have only half of the tables and I see that after letter L (log_visitors table) there are no tables.
Its very strange, could someone give me idea what is it about?
On my version of phpMyAdmin, there is a checkbox with the following text on the Import page:
Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. (This might be good way to import large files, however it can break transactions.)
Make sure that checkbox is unchecked (by default it is checked), else it may be causing your problem.
So we turned on the "enclose in transaction" and "disable foreign keys" checkfields on phpMyAdmin while exporting, and also seperated export in two .sql files. It worked.
Note that the problem wasnt standard php timeout or standard phpMyadmin limitations on uploading big files, as we previousuly also tried bigdumb and ssh commands for import and it didnt worked.
As #Willem stated, you could have that option checked when you import the sql file.
But if you're still not be able to import it after unchecking that option, this means that the file you are importing is too big.
In this case you can use the mysql command line utility, if you have SSH access to your server or you can try bigdump, a php script that let's you import a database splitting the SQL query in chunks!
Hope it helps :)

Categories