Jump to content
xisto Community
Sign in to follow this  
iGuest

How To Execute sql file to create table

Recommended Posts

Hi..Please help me :roll: How to execute sql file ( e.g nuke.sql ) to create table in mysql data baseI don't have cpanel/PHPmyAdmin. Whats the comand to execute sql file at my server :?:my server suport mysql databaseThanks :D

Share this post


Link to post
Share on other sites

1. go to cpanel

2. make sure you create a database and remember

a. User name

b. User password

c. Database name you will need these later

**make sure you remeber these because you will need them later**

 

3. ok , now go to phpadmin and select the database in the blue colomum to the left that you created. select that file .

 

4. it will bring you to a nav bar that says Structure< SQL< Export< Search <Query

 

5 click on the SQl tab

 

now at the bottom of that page you will see asearch bar that says location of text file, l** leave it on auto detect now press browse and then look for the file name nuke.sql in your computer

**You know where that is**

5 then upload and now you have your tables :D:D:D

 

6. the last step is configuring your php-nuke with your database real easy. go to your directory and look in the php-nuke file config.php and look for this code.

$dbhost='localhost';

$dbuname='database username here';

$dbpass='database password here ';

$dbname='database name';

$prefix = "nuke";

$user_prefix = "nuke";

$dbtype = "MySQL";

 

if you entered all of those correctly, u should be ok and make sure to redirect your you home file to the php-nuke file

 

if ll else fails use script libary and install php-nuke from there. thats what i did its real easier. :D:D

Share this post


Link to post
Share on other sites

What type of Control Panel have you got on your server then? How do you manage your site?Have you made sure MySQL is available?Give more details

Share this post


Link to post
Share on other sites
<?php$handle = mysql_connect("host_name", "username", "password");$db = mysql_select_db("db_name", $handle);$query = "CREATE TABLE table_name(var1_type var1, var2_type var2, var3_type, var3...)";$result = mysql_query($query);?>

That's a simple one. You'll have to modify it.

EDIT: Oh, and that's using PHP. If you don't have PHP, you can use the mysql console, by running "mysql".

Share this post


Link to post
Share on other sites

How.. man ? my server is using internal control panel, and has no command or tools to manage the database.No PhpAdmin, No Cpanel, No Pleskand it's make me confused how to create table in MySQLIs there any command to run SQL file if I wish to create table without using cpanel or phpmyadmin?Thx Buddy..!

Share this post


Link to post
Share on other sites

Tell you one thing? Why are you hosting your site where you do not have CPanel or PHPMyAdmin? Better host it with some host that offers CPanel. For e.g. - FNH.

Share this post


Link to post
Share on other sites

I make php file with your code, then I upload it, and I run in my browser... Is it correct?


Well, you'll have to put all the statements in your SQL file into the query, but yeah, that's right.

Share this post


Link to post
Share on other sites

In php/mysql i want to create 10 tables and add data to each one, but the file size is still small enough...I'm incorporating this into a broswer based upload/backup script without using cpanel.... in phpCan i just put$query = "all of the sql info - for multiple tables and insertion and updation";$result = mysql_query($query); in one file.Will $result process all the queries if they are only defined as one big query? - or do i need to set it for each command

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.