Solved

mysql db setup problem with CrystalTech web host

Posted on 2007-11-19
7
408 Views
Last Modified: 2013-12-13
I'm trying to help a friend set up  a free calendar app on their php account that's hosted with crystaltech.com. It looks like php is running on a windows server. The control panel allows creation of a database and the ability to specify users for that db.

The calendar app uses a sql file to create and populate the tables. I asked the host about phpmyadmin or anything else that would let me run this file. They told me I would need to install a standalone version of phpmyadmin on my local computer. This seems really absurd to me. I don't understand why good db interaction tools are not provided by default. It also looks like I would have to have a local linux box setup in order to do this (which i don't). So my questions are:

1. Is there a true standalone phpmyadmin option available that will run on windows (without having to install php and mysql)?

2. Should my friend just switch hosts?

3. Is there a different solution to this problem I don't know about?

Thanks.
0
Comment
Question by:sstahnke
  • 4
  • 3
7 Comments
 
LVL 21

Expert Comment

by:nizsmo
ID: 20313959
1. PHPMyadmin cannot run without PHP and MySQL, as it is firstly a tool to interact WITH mysql database and second is written in php

2. not sure, but what they are demanding is probably not usual..

3. can you clarify what you are trying to do with the .sql file? as you stated the calendar app uses the sql file to create and populate tables, why are you trying to "run" the sql file?
0
 

Author Comment

by:sstahnke
ID: 20314349
I don't use php very often so bear with me. i'm referring to the process in phpmyadmin where you select the appropriate db and then browse for a .sql file and then submit the form. This results in the sql code in the file being executed which creates and populates the necessary tables.
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20319081
and the host doesn't have PHPMyAdmin installed right?
I understand, so you are trying to import into the mysql database all the tables using the .sql file.
mysqldump may be another option, if you have access to the mysql commandline?
http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

hope this helps.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:sstahnke
ID: 20320695
I'm fairly certain I don't have command line access. There was one "connection testing" area in the control panel but they don't allow you to use any of the sql commands you really need (CREATE, DELETE, ALTER, etc). It looks like all you can do there is run select statements.
0
 
LVL 21

Accepted Solution

by:
nizsmo earned 250 total points
ID: 20323198
really??? that stinks, so to clarify you have asked them how to "import" the database and populate the tables from an sql file and they simply said get a standalone phpmyadmin?

Also do you have PHP access and can PHP connect to the database? if you can then maybe you can use PHP to execute the sql file (untested) like so:
(modify the settings accordingly)
$db = mysql_connect(....);
mysql_select_db(....);
 
$fp = fopen('somefile.sql', 'r');
while($fp != feof())
{
$line = fread($fp, 2048);
$line = mysql_real_escape_string($db, $line);
mysql_query($line);
}
fclose($fp);

Open in new window

0
 

Author Comment

by:sstahnke
ID: 20323312
that is what they said. I was kind of shocked. I should have php access. I'll try that.
thanks.
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20323340
MAY have to test and trial with that code, try with a smaller sql file first.
also i'm not sure if that code takes comments, as i said trial and error, otherwise think about changing hosts to someone who has phpmyadmin installed!

if you need to find a host, let me know i know a very good one.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP installation issues 11 59
Exporting image to excel from php document 10 27
unable to insert record into a table 2 29
does post require a form or curl to be post 4 29
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question