If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > executing .sql files

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-10-09, 05:03
johnyjj2 johnyjj2 is offline
Registered User
 
Join Date: Aug 2009
Posts: 6
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!
Reply With Quote
  #2 (permalink)  
Old 08-10-09, 05:17
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,258
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 08-10-09, 05:20
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
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
Reply With Quote
  #4 (permalink)  
Old 08-10-09, 05:37
johnyjj2 johnyjj2 is offline
Registered User
 
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!
Reply With Quote
  #5 (permalink)  
Old 08-10-09, 06:08
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
Quote:
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.
Reply With Quote
  #6 (permalink)  
Old 08-10-09, 06:28
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,258
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #7 (permalink)  
Old 08-10-09, 06:35
johnyjj2 johnyjj2 is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 08-10-09, 06:53
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,258
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #9 (permalink)  
Old 08-11-09, 07:42
johnyjj2 johnyjj2 is offline
Registered User
 
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!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On