Mav2u Posted June 2, 2003 Posted June 2, 2003 Okay, I have a .PHP script that requires me to execute the CreatDB.sql file to creat a MySQL database. I'm not sure if or how I can do this. Does anyone know how I can make this happen. I have posted below the entire readme file for setting up on the server. I have edited the other files as it instructed, I just don't know how to make this thing create a MySQL database using these commands. I use CuteFTP Pro to upload my files or Cpanel's File Manager also. A2Z - WebBased Addressbook v.1.0.2 December 5th 2000 http://www.max-one.net/ <-- Thanks to cybercat.qc.ca for hosting! http://a2z.sourceforge.net/ Hi everyone! Thanks for trying / using A2Z (GPL). 1.The requirements 2.A few steps and we're done 3.Information for PowerUsers Here is how to set it up: 1.First, the requirements MySQL and the rights to create a database PHP4 A text editor 2.A few steps and we're done Copy all the files to your web directory; lets say we use /a2z for the purpose of this document. Change directory to a2z/sql/. To set the password the database will use, execute the following steps: $ vi CreateDB.sql :g/set_password/s//THE_PASSWORD_YOU_WANT/ :wq You know have set the password that MySQL will use. Now, lets build that DB. $ mysql < CreateDB.txt There you are! Now go into the a2z/programs/ directory. Change the password by executing that same command as we did previously. $ vi dbkey.inc.php :g/set_password/s//THE_PASSWORD_YOU_WANT/ :wq Allright! One last time... You must change you name and e-mail address. $ vi programs/master.functions.inc.php :g/Your_Name/s//YOU_REAL_NAME/ :g/youremail@domain.net/s//YOUR_REAL_EMAIL/ :wq You are now ready to access A2Z by your web browser and enter any information you want. Just point your browser to /a2z/ or your own installation directory. 3.Information for PowerUsers The database name, username and password are to be modified in programs/dbkey.inc.php and sql/CreateDB.sql Your name and e-mail are in programs/masterfunctions.inc.php Until next time, have fun! Max Thanks for any help you can give, Mav Quote
surefire Posted June 2, 2003 Posted June 2, 2003 The way I would do it... would be to use phpMyAdmin to create the database and set the password. That's basically what it's saying here... but it doens't want to assume that you'll have phpMyAdmin... which makes life so much easier. Take a look at the post I put in the scripting forum called 'How to set up a MySQL database." I'd give you a link... but I'm literally running out the door this second. Quote
Mav2u Posted June 2, 2003 Author Posted June 2, 2003 Yeah, I can create a database no problem. Only thing is I need to create all the tables by hand and all that stuff. If I could find out how to run this bad boy in some kind of command screen, I would be good to go. I tried creating some of the tables but my SQL skills are a little lacking on making sure my syntax and what not are correct, as I usually get errors when trying to make one by hand. I'll post the database file here to show everyone what tables and everything that it is trying to make. # These lines will create the DB needed to run *a 2 z*.# In order to create the database, you must execute the # following command: # # mysql < CreateDB.sql # see readme.txt for more information # # DROP DATABASE a2z\p\g CREATE DATABASE a2z\p\g USE a2z\p\g CREATE TABLE Person (ContactID int(4) AUTO_INCREMENT PRIMARY KEY NOT NULL, LastName VARCHAR(255) NOT NULL, FirstName VARCHAR(255) NOT NULL, SubGroup VARCHAR(255) )\p\g CREATE TABLE Email (Serial int AUTO_INCREMENT PRIMARY KEY, ContactID int(4) NOT NULL, Address VARCHAR(255) NOT NULL, Location VARCHAR(255) )\p\g CREATE TABLE PhoneNumber (Serial int AUTO_INCREMENT PRIMARY KEY, ContactID int(4) NOT NULL, intlPrefix VARCHAR(4), RegionalCode int(3), PartOne int(3), PartTwo VARCHAR(4), Ext VARCHAR(5), Location VARCHAR(255) )\p\g CREATE TABLE Address (Serial int AUTO_INCREMENT PRIMARY KEY, ContactID int(4) NOT NULL, Location VARCHAR(255), Street VARCHAR(255), City VARCHAR(255), State VARCHAR(255), Country VARCHAR(255), PostalCode VARCHAR(8) )\p\g GRANT ALL PRIVILEGES ON a2z.* TO a2z@localhost IDENTIFIED BY 'set_password' WITH GRANT OPTION \p\g # EOF I tried making them by hand but I always seemed to make a mistake trying to make the individual tables. Mav Quote
surefire Posted June 2, 2003 Posted June 2, 2003 In phpMyAdmin, you go to the main screen that comes up, and you hit the 'SQL' tab. This gives you a form where you can post that code into the text box. Hit the submit button. Your tables are created. That's also how you could repair a damaged database with a 'dump file' aka backup. Quote
Mav2u Posted June 2, 2003 Author Posted June 2, 2003 Ah, I see! I'll try that out, I was wondering what that box was for but I didn't want to mess anything up. I'll give it a try and see what happens. Thanks for the assist, Mav Quote
Mav2u Posted June 3, 2003 Author Posted June 3, 2003 Umm, No such luck with the inserting the text into the box. Apparently the code is full of mistakes or something, if anyone can figure this stuff out I would greatly appreciate it. I would love to be able to use this address program. I just can't seem to get this SQL portion figured out. This is the website where I got the script from if someone wants to look it. http://a2z.sourceforge.net/ Mav Quote
surefire Posted June 3, 2003 Posted June 3, 2003 Okay. I downloaded the script to take a look at it. From what I know (and I certainly don't know everything ) it appears that you are supposed to run this setup code from the 'command line' of mysql. Since I've used phpMyAdmin to install every single script I run, either borrowed or home brewed, I really can't tell you how or even if it can be done from CPanel. If it were me, I'd probably look for another script. But since you've indicated that you are very intent on setting up this script, I'd say that you could very easily create the database and table one by one in phpMyAdmin. There are only five or so tables and they're very small. Another option would be for you to email the creator of the script at Sourceforge.net There's a small possibility that he would send you a text file with the code you could paste into phpMyAdmin. If somebody else can help out Mav2u, please step in and take over for me... Quote
Lianna Posted June 3, 2003 Posted June 3, 2003 Gimme just a bit to look this over. Normally, the sql dump can be edited, deleting all the excess lines, etc. then pasted into the phpMyAdmin SQL window. Hang on, let me see what we have. Quote
Mav2u Posted June 3, 2003 Author Posted June 3, 2003 Thanks, I appreciate the help on this matter. TCH Rocks Mav Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.