I would like to save database schema using describe function to visualise the tables for others in a team, in mysql terminal you can use describe tablename which would output in a table all in text which I would simply pipe to a text file.
In this current environment I do not have access to mysql terminal but only through phpMyAdmin, is there a way I can get a table view using text in phpMyAdmin? I know phpMyAdmin has its own print view but this is not what I want, I want just plain text.
The nice "table as text" rendering that the mysql console is doing is unique to that software.
It is basically how mysql console renders any result set that you get from your query.
PhpMyAdmin will render all the results sets in a HTML table. As far as I know they do not emulate the text output because they have no reason to.
If you are able to run a PHP script on that machine you could use that to render the result set as text and display it in a webpage.
Phpmyadmin has an export function.
If you export only the structure of your database, but not the data, and you export it to SQL format, you will get a text file with your database's DDL nicely formatted.
That should help you document the database for your team.
Related
I have tried to find an answer for this elsewhere but cannot, I hope someone can help me.
I am trying to import the MySQL sample database into Oracle SQL Developer.
I have an existing database/connection I want to dump it into. I have created an empty table named classicmodels in my existing connection. Yes that name is only 1 table within the sample db, correct. Ignore the error in naming convention.
When I R-click on it and try 'import data' I cannot import a .sql file, I can only do it with XL, CSV, etc.
When I try and run a script it found on dba.stackexchange
#\path\mysqlsampledatabase.sql , I get a series of 'please provide substitution value' messages, which does not make sense to me given that I am importing a database which is built for SQL (ie what reason is there to substitute).
Pictures below:
The 'UnseenCollection' is a single table I imported as a csv file. I need to import the mysqlsampledatabase file such that it shows up the same way, I can access all tables within the sample db.
Anyone can help I would appreciate it. I need the end result to be the entire mysqlsampledatabase to populate within the 'classicmodels' node.
Thank you.
connect to MySQL
connect to Oracle
for a single MySQL table, right-click, 'Copy to Oracle'
for a few tables, select, drag and drop onto Oracle connection (requires newer version of SQL Developer)
for an entire MySQL database, use the migration project feature
I want to open a Huge SQL file (20 GB) on my system i tried phpmyadmin and bigdump but it seems bigdump dose not support more than 1 GB SQL files is there any script or software that i can use to open,view,search and edit it.
MySQL Workbench should work fine, works well for large DB's, and is very useful...
https://www.mysql.com/products/workbench/
Install, then basically you just create a new connection, and then double click it on the home screen to get access to the DB. Right click on a table and click Select 1000 for quick view of table data.
More info http://mysqlworkbench.org/2009/11/mysql-workbench-5-2-beta-quick-start-tutorial/
Try using mysql command line to do basic SELECT queries.
$ mysql -u myusername -p
>>> show DATABASES; // shows you a list of databases
>>> use databasename; //selects database to query
>>> show TABLES; // displays tables in database
>>> SELECT * FROM tablename WHERE column = 'somevalue';
It totally depends on the structure of the database, one way of handling this is by exporting each table in a seperate sql file, as for editing the file, you're limited to opening the raw sql files in notepad or any other text editor. But you probably already knew that.
What are the settings that were used to export the database? People often forget that there's also an option to turn on comments, for big databases it makes sense to turn that off.
To get a more detailed answer have you tried asking at https://dba.stackexchange.com/?
I have downloaded a mysql table in text format from one our collaborator's. I have dumped the table into a table on mysql database on my machine successfully. The table was created using their sql file. SO they have some of the fields with blob data-type, and I am unable to view them in mysql. when I opened the same downloaded text file with csv I could see the fields with blob data-type with letters like BC,ABD,BDS. I do not understand why I am unable to view the fields in mysql. Anyone have ideas?
This is sure you can not see the blob data directly when you view the table data from mysql. But i think when you click the edit link of particular row you might see the data but i'm not sure about this. If you are using any server script then you definitely gonna see data without any hassle using simple select query. Like
SELECT COLUMN_NAME FROM TABLE_NAME
// REGARDLESS OF COLUMN_NAME DATA TYPE
I have a MySql database on my server with a table named table_1. However I imported a csv file which occasionally included "café". However the "é" was not inserted into the database table, so I have been left with the text "caf". So what I would like to know is how can I replace the word "caf" in my database table with "cafe"?
Looks like an encoding issue to me - make sure you're using UTF-8 throughout your DB, and reimport your CSV.
If you've used the LOAD DATA command in MySQL, you can pass it a CHARACTER SET, which, when set to 'utf8' should allow you to import that file correctly.
This is a common problem of encoding. I sugest that you change your mysql database to utf-8 via GUI or with this information
I have a MySQL table where I store text entered in any kind of language. The text is displayed correctly on the website, example but when I export the data to Excel I get garbled text.
I tried exporting the data via PHPMyAdmin and even just doing something from the command line like mysql -user -p db < query.sql > export.tsv and I get garbled text. For example instead of animación I get animación or instead of แอนนิเมชั่น I get à¹à¸à¸™à¸™à¸´à¹€à¸¡à¸Šà¸±à¹ˆà¸™.
This could be a combination of factors involving Excel, MySQL and PHPMyAdmin, but I imagine others have tried to do the same.
Excel and Mysql support Unicode fully, but PHP (I think) doesn't have very good Unicode support, so you may be having trouble exporting from PHPMyAdmin for that reason.
Look on the web for a good mysql manager which will export data from your tables correctly in Unicode format and you should be fine.