Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have mysql, apache, php, and webmin installed on my machine and would like to create a new mysql database with webmin. I go to create a new database and from there i am lost... Can someone point me in the right direction to get this new database created. I want to be able to have a site that will enter information and pull information back from this database with php.
You're right, that is a broad question... I will try to narrow it down. From webmin I click create database, it brings up a 'New database options' dialog. This is where it starts getting a little fuzzy, 'Database Name (that i can understand), 'Initial Table = none', 'Initial Table Structure' - not sure what these options are. I am new to databases and unfamiliar with their terminology. I still don't think I've actually asked a question but I knew this was the best place to start.
Ok we can work with that, I will start here and see where it goes.
1st. Go into webmin and click on create database put in the name you want for the database and click none on the intial table and don't fill out the rest click create.
Then you have to decide what data you are putting into the database. for a simple one that holds employee addresses you would click on the database you just created and click create new table, you will have to put in how many fields you want in it, for our address's table there would be 4
id - type will be "int" width will be 4
name - type will be "varchar" widht will be 60
address - type will be "varchar" width will be 100
phone - type will be "varchar" width will be 15
you will put in the fields shown above into the new table and then click create table, this is now a database that is ready to accept data.
Now you should never access a normal database as the root database user so you need to create a mysql user in webmin, this is done the same place that you created the database. Click on on user permissions then create new user, give them a username and a password and set the hosts to localhost don't give them any permissions.
Save that user and then go to database permissions, (same places as add new database and users) and click create new database permissions. Select your new database. then type in the username you just created and set the hosts to localhost. Give them full permissions, (select all the options from the list) and then save that.
You will now have a working database with a user set up to access it. whew.
After reading this post and what you have running it occured to me that you might be trying to setup phpnuke or postnuke. If this is the case, then follow the instructions that cli_man posted, except that these programs have built in scripts to create the tables for you.
If not, and you are writing your own php script that you want to use mysql then ignore what I am saying and do everything that he posted.
From his origanol questions I took that he wanted to set up the database and programming from scratch. But if he is trying to install a php program that needs mysql support he would not have to worry about creating the tables just the database and permissions like I said above.
Cli_man you are correct I am trying to set this up from scratch. I followed your instructions on the database side and all worked well. Now I have some php code that I got from somewhere else with someone trying to do basically the same as me. However it does not work for me, any suggestions, below is the code, thanks in advance.
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * From Customer_Information WHERE Title like '%Customer%'";
$result=mysql_query($query) or die (mysql_error());
You might be running into a register_globals problem. I didn't think of that, all of my programming has been done with register_globals set to on and the default now is off, you can check by making a php file that only has this in it:
<? phpinfo() ?>
Then go to that page and see if register_globals is set to on or off. Post back what you find.
Ok, I think that may be the problem with the script I gave you. You have to access variables differently when the register_globals is off, I haven't gotten into that yet because I haven't had the time. For now if you want you could turn it to on (sidenote This makes your scripts less secure)
To turn it to on find you php.ini file and find where it says register_globals and change it from off to on, save the file and restart apache. Then that script should work for you.
And just to say again what I did above, it is a good thing to have register_globals set to off, I just don't know how to program with it that way yet.
I turned globals on and it still doesn't connect. It is still failing on line 7, couldn't connect. Maybe a database permissions problem?? I've deleted and started over with a new database but still doesn't work.