Does phpmyadmin have a function like access to split one tabe into multiple tables? - mysql

I have an Excel spreedsheet with all my info saved in it. From the spreadsheet I save it as 2 CSV documents. The reason for saving it as 2 documents is because my host refuses to increase the upload size in phpmyadmin. I upload the documents into a table and use it from there. But this is not the correct way to use a database. If I import my Excel spreadsheet into MS Access there is a function that I can Split the table into multiple tables that have relations and ID's so that everything is only saved once linked very nicely. The function in Access is called 'Analyze Table' but the analyze table in phpmyadmin clearly isn't the same.
I have tried to build my own databse in excel and then export it to phpmyadmin but when trying to import data into my main table with all the relations it spits this message back to me 'Cannot add or update a child row: a foreign key constraint fails'.
What is the best way to import a large spreedsheet into phpmyadmin so it works like a proper database?
Please help as I'm at a dead end
Many Thanks

Related

How to import single CSV file with more than one table to MySQL database

I've just found that I can import a CSV file to MySQL table. I tried it on phpMyAdmin, but I also found out that by importing a CSV file, its columns need to match the mysql database table you are importing to. This means one CSV file equals one table only in the SQL database, correct me if I'm wrong though.
The problem is the employee table I'm inserting data to, is related to other tables. There's also the rolemap table where when every employee is inserted in the employee table, the rolemap table also creates a new row for that new employee(only inserts the employee_id generated by the employee table, then the role of the user if admin or not).
The question is can I achieve this logic, by importing a CSV file in phpMyAdmin or any database manager? I'm thinking that maybe there will be some formatting that needs to be done in the CSV file in order to import to different tables in the database. Or is this not possible, that I need to parse the CSV file in a backend and handle how to insert it to each respective table in the database?

How to import excel to mysql database?

How can I import an Excel file containing data from three different tables with foreign keys into a mysql database?
A very simple way to do it is working with Excel itself. In order to help you we need more details about the Tables in the excel and the tables in the database but you will get it:
Make a new column and using formulas with CONCATENATE, do a sample "INSERT INTO" command. Use series for do the INSERT's automatically, copy & paste the column into a .sql file and execute it.
If you need more detail, if you edit your question and I will glade to help you improving this answer.

MS Access 2013: Automate skip importing column if not already in pre-existing table

One really annoying thing about Access is that when using the import wizard to import a CSV file, if there is a column in the CSV that isn't a field in the table being imported into, it gives you an error and shuts down the import. It should provide an option to skip columns in the source file if it isn't in the already existing table. Yes, it does give the option to skip if creating a new table from the source file, but that isn't what I am doing. Is there a solution to this or a way to automate it? Does using the VBA Access import function permit this?
The reason I want to skip these columns is because they were calculated columns in Excel file submitted by client, file is converted to CSV for importing in to Access, and I can easily recalculate them with SQL in Access. No reason to have them in the table.
When running the import wizard, you can save the specifications by some name you choose.
Then use:
DoCmd.TransferText acImportDelim, SpecificationName, ... etc.

How do I import Excel data into a MySQL table?

I have a table mileage_registrants which keeps users registration data. It has a field department which is NULL for all users now. I want to insert department data from a .xlsx file into table department. There are one thousand records so it is horrible for me to insert them by hand.
Is there anyway for me to get this done quickly?
Assuming you have access to PhpMyAdmin, you may want to export your xlsx to CSV format, then import it using PhpMyAdmin import tool.
Beware of the encoding though!
you can do it via excel itselfe.
Here you can find a quick tutorials of you to interact with excel from mysql
http://www.heritage-tech.net/908/inserting-data-into-mysql-from-excel-using-vba/
http://www.heritage-tech.net/267/interfacing-with-mysql-via-excel/
http://blog.tjitjing.com/index.php/2008/02/import-excel-data-into-mysql-in-5-easy.html
It is highly recommended to do a dry run before running on production

Appending rows in a database using toad and excel

Friends, I am using toad for MySQl, and have a huge database ready and validated.
Now i have an excel file which contains data-entries for a particular table. And i am also successfully able to import data into the db using import wizard, mapping the first row header with the column names etc.
But now i have appended a few data entries into it which i wish to insert into the database. However the old values also get selected and hence cause a primary_key_violation exception as the entry already exists! Otherwise a truncate table option is there which i dont wish to use as there may be many files from which i have inserted the data.
I tried my level best but didnt get any solution, atleast in toad for mysql. Please tell me what to do! the solution maybe simple but i need it SOS
An option may be to not append records to that excel file, but create a new excel file with only the new records