Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2009
    Posts
    6

    Unanswered: executing .sql files

    Hello!
    I've got really basic question. I've got installed MySQL Server 5.1. I also have file CreateDb.sql and I'd like to execute it. I don't see any icon of MySQL on bottom right corner of remote desktop of server (there are only those of Apache etc.).
    I was googling for it and I found that the possible approaches are:
    "I could run that script using profiler menu option File -> Open-> SQL Script" - I don't know how to enter any profiler.
    Use "isqlw -Usa -P -i file1.sql" - I don't see isqlw.exe in F:\Program Files\MySQL\MySQL Server 5.1\bin
    Use "sqlcmd" - I don't see this one as well, there are many exe files, e.g. mysql.exe, but not this one.
    Greetings!

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you can run any SQL files in a suitable query client such as MySQL Query Browser available form the MySQL site as part of the GUI desktop tools. Im pretty certain that HPHMyAdmin will do the same and also Heidi SQL
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    sqlcmd and isqlw are for Microsoft SQL Server as far as I know.
    So it makes sense that you don't have them.

    mysql.exe is the console interface for MySQL, you can use that one to run your SQL statement.

    For details see the manual:
    http://dev.mysql.com/doc/refman/5.1/en/mysql.html

    As you don't seem to have any experience with MySQL I recommend you start with the tutorial first:

    http://dev.mysql.com/doc/refman/5.1/en/tutorial.html

  4. #4
    Join Date
    Aug 2009
    Posts
    6
    Thanks!

    I downloaded and unzipped PHPMyAdmin. I try to run index.php but just Notepad opens. I guess there may be something wrong with my installation of MySQL.

    I've got F:\PHP with directories dev, ext and some files like php.exe. I run it and see: "PHP Warning: PHP Startup: Unable to load dynamic library 'F:\php\ext\php_mcrypt.dll' - The specified module could not be found. in Unknown on line 0".

    What can be the reason that there is no this file? Do I have to reinstall PHP? (I am not the one who installed this server and this PHP so I'd better not reinstall it. I'm not admin but just trainee in the company ).

    I also have got F:\Program Files\PHP with one file php.ini.

    Greetings!

  5. #5
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    I try to run index.php but just Notepad opens. I guess there may be something wrong with my installation of MySQL
    That has nothing to do with MySQL.
    PHPMyAdmin is a PHP application and as such needs to be deployed into your Apache. Once it is installed correctly into Apache and the Apache server is up and running, you access PHPMyAdmin using your browser.

    I would strongly recommend starting with the command line tool first, so that you know the basics.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    command line tool is a smart way to go...

    but if you are going to use a GUI tool why not use MySQL Query Browser?
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Aug 2009
    Posts
    6
    I run from Command Propt "F:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -u root" as it is written here mysql - Command Line Tool but I see: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO). The same for admin and name_of_my_user_account. I cannot run "mysql /help" or "mysql ?" or anything like this because of similar problem (Access denied for user 'ODBC'@'localhost').
    Greetings!
    PS I'm going to install and try this MySQL Query Browser for a moment.

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    go for the full set, not jsut query browser. I find it easier, less problomatic to use adminstrator to set permissions... and its a permissions problem you have

    you need to make sure what ever userid you are using has adequate permissions for the tasks you want to complete.
    in the command line you need to use GRANT, with MySQL Adminsitrator its much easier
    I'd rather be riding on the Tiger 800 or the Norton

  9. #9
    Join Date
    Aug 2009
    Posts
    6
    Thanks!

    I found two things on the server - MySQL Tools for 5.0 and phpMyAdmin.

    I've got F:\Program Files\MySQL\MySQL Tools for 5.0 and in this directory there are grtsh.exe, MySQLAdministartor.exe, MySQLMigrationTool.exe, MySQLQueryBrowser.exe, MySQLSystemTrayMonitor.exe, MySQLWorkbench.exe and many other, non-executable files. I run MySQLAdministrator.exe, I try to find where to execute script and I cannot.

    I also try to run on Internet Explorer by writing F:\Inetpub\wwwroot\index.php. It opens me the file in Notepad.

    Greetings!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •