Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Inserting Db Scripts?

forums forums SQLyog Using SQLyog Inserting Db Scripts?

  • This topic is empty.
Viewing 7 reply threads
  • Author
    Posts
    • #10329

      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.

    • #23978
      peterlaursen
      Participant

      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.

    • #23979

      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.

    • #23980
      peterlaursen 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,

    • #23981
      peterlaursen
      Participant

      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.

    • #23982
      peterlaursen 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.

      sql1yo0.jpg

      i create the new database.

      sql2yq8.jpg

      it asks for a name of the new database.

      sql3zc4.jpg

      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.

    • #23983

      mysql4ln1.jpg

      according to what im reading in the help file i need to insert the script using the above pictured command.

      mysql5th2.jpg

      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,

    • #23984
      peterlaursen
      Participant

      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.

Viewing 7 reply threads
  • You must be logged in to reply to this topic.