Solved

mysql db setup problem with CrystalTech web host

Posted on 2007-11-19
7
404 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
Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now