forums › forums › SQLyog › Using SQLyog › Inserting Db Scripts?
- This topic is empty.
-
AuthorPosts
-
-
May 11, 2007 at 3:42 am #10329MontanaBighornMember
i host several web forums on a home based server using windows 2000 server.
im attempting to switch over from MS access to mysql for .asp based web
forums. the particular software that im looking at offers a script to
create the forum mysql DB, but i dont know what to do with the script. here
is a small sample of nearly 1000 lines of script:
CREATE TABLE `album-tool-variables` (
`motd` text NOT NULL,
`currentver` float NOT NULL default '0',
`upgradelocation` varchar(100) NOT NULL default ''
) ;
CREATE TABLE `albumnotifications` (
`albumid` int(11) default NULL,
`memberid` int(11) NOT NULL default '0'
) ;
im new to mysql and learning it as i go along. ive installed the current
5.0X from mysql.com as well as sqlyog. im able to create
DBs with sqlyog, but i dont know how to use the script in the DB. any help
would be appreciated.
-
May 11, 2007 at 8:08 am #23978peterlaursenParticipant
Once you have a SQL-script (with correct syntax for mysql) you import to MySQL from the SQLyog 'tools' menu. You must of ocurse connect to mysql first!
It is very smple actually. However there are two issues you should know:
1) If the dump file is created with mySQL 4.1 or higher it will not import on 4.0 or lower
2) If ther is no CREATE DATABASE and USE statement in the file you will need to start creating it manually and selecting it.
-
May 11, 2007 at 3:50 pm #23979MontanaBighornMember
thank you for the reply sir. however, under the current version i do not see an option for “import”. also, under “table” there is “paste sql statements” but after i mouse over that the options arent highlighted. please explain, and thanks a bunch.
-
May 11, 2007 at 3:54 pm #23980MontanaBighornMemberpeterlaursen wrote on May 11 2007, 02:08 AM:2) If ther is no CREATE DATABASE and USE statement in the file you will need to start creating it manually and selecting it.
i also dont know what any of that means. i stuck a copy of the script at http://UtilityOffRoad.com/1.txt if youd care to take a peek at it.
thanks again,
-
May 12, 2007 at 11:41 am #23981peterlaursenParticipant
I checked your script!
1) There is no 'USE some_database' statement The script simply starts CREATE TABLE … To import with SQLyog you should start creating an empty database (right click in 'Obkject Browser (the left window) … create database) and select this one before running the SQL script! If no databse is selcted you will get the error 'no database selected' (how logical can the world be? 🙂 )
2) Your script will import on every MySQL version. tTere are no ENGINE or CHARSET specification in the file that are specific for some MySQL versions only. Seems like you exported from MySQL 4.0 or lower.
-
May 12, 2007 at 3:35 pm #23982MontanaBighornMemberpeterlaursen wrote on May 12 2007, 05:41 AM:To import with SQLyog you should start creating an empty database (right click in 'Obkject Browser (the left window) … create database) and select this one before running the SQL script! If no databse is selcted you will get the error 'no database selected' (how logical can the world be? 🙂 )
i dont really understand where the script comes in.
i create the new database.
it asks for a name of the new database.
it creates the database.
….but nowhere in that process does it ask me to insert the sql script. i guess im clueless about how to run the script or where to insert it, and i really do appreciate the effort youre taking to explain it to me. thank you again.
Quote:2) Your script will import on every MySQL version. tTere are no ENGINE or CHARSET specification in the file that are specific for some MySQL versions only. Seems like you exported from MySQL 4.0 or lower.its downloaded from the website where i downloaded the forum software.
-
May 12, 2007 at 3:58 pm #23983MontanaBighornMember
according to what im reading in the help file i need to insert the script using the above pictured command.
but when i click on the table and then attempt to use the “insert from CSV” command its faded out and wont let me select it as an option. any idea?
thanks,
-
May 13, 2007 at 7:58 am #23984peterlaursenParticipant
First: is the file that you try to import a CSV file or SQL file? You will
To import a CSV a table must be selected in the Object Browser. The table structure must match the data in the CSV file. A CSV file only contains data for a single table.
If only a databse is selected most options in the tablel menu will be greyed out. To perform operations on table(s) you will ahve to tell the program (by selecting the appropriate table) on which table the operation shall be performed.
But I first understood that the file was a SQL dump?
Personally I think using the contect menus (right click menus) from the Object itself in the Object Browser is more intuitive. From here only the options that are possible with the the Object chosen will be displayed.
-
-
AuthorPosts
- You must be logged in to reply to this topic.