Results 1 to 6 of 6

Thread: Working with MySQL database

  1. #1
    Join Date
    Jan 2010
    Posts
    53

    Working with MySQL database

    Hello sir ! As I am new guy for MySQL database and I don't know how to connect to database server. I have been assigned with a user name and password but I didn't get the ways to create a connection to database.
    Please help me perform this task.I will be highly thank full to you.

    Thanks.

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Working with MySQL database

    Working with MySQL database :

    MySQL is a very popular, most reliable database management system software with the facility of Open Source SQL management.The world's largest corporation Sun Microsystems introduced with a new concept of Relation database management and designed, distributed which can be supported with different platform.

    MySQL is a relational database management system which provide the management of Database Server is very fast, reliable, and easy to use.It can be constructed with the the client/server or embedded systems.
    Last edited by opaper; 12-02-2010 at 09:46 PM.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Connecting to MySQL database

    Connecting with MySQL database :

    You can connect with MySQL database but before that you need to create the database using provided tools of MySQL.Once you create a database you can easily connect with different ways :

    Come on a shell prompt and type

    mysql -u DBUSERNAME -h DBSERVER -p DBNAME
    where DBUSERNAME specifies the name of the user and DBSERVER requires the correct database servername for your site and DBNAME requires the name of MySQL database.

    After that you would be prompted for the password.Enter the password and you get a prompt of Mysql simply.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Connecting to MySQL database using PHP script

    Connecting to MySQL database using PHP script :

    You can connect with MySQL database using PHP script after putting connection code inside the PHP script which would be as follows :

    Code:
    <?
    mysql_connect("DBSERVER", "DBUSERNAME", "DBPASSWORD");
    mysql_select_db("DBNAME");
    ?>
    The highlighted things are necessary to connect with the database and fill it carefully.

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    Connect to MySQL database with perl script

    Connect to MySQL database with perl script :

    You can connect with a MySQL database using some defined code and put it into your file and get connect easily with database :

    Code:
    #!/usr/bin/perl
    use DBI;
    
    $database = "DBNAME";
    $hostname = "DBSERVER";
    $port = "3306";
    $username = "DBUSERNAME";
    $password = 'DBPASSWORD';
    
    $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";
    
    $dbh = DBI->connect($dsn, $username, $password) or die("Could not connect!");
    
    $sql = "SELECT * FROM mytable";
    
    $sth = $dbh->prepare($sql);
    $sth->execute;
    
    
    while(($column1, $column2) = $sth->fetchrow_array)
    {
    print "C1 = $column1, C2 = $column2n";
    }
    
    
    $dbh->disconnect;
    The required field are necessary to fill with the proper information.Where DBNAME is the name of database,DBSERVER is the name of server to which you would connect,DBPASSWORD requires absolute password for the database to be connect.
    Last edited by Katty; 12-02-2010 at 10:17 PM.

  6. #6
    Join Date
    Apr 2008
    Posts
    2,005

    Changing the password of MySQL database

    Changing the password of MySQL database :

    You can change the password of MySQL database at a shell prompt. Get connect first and when you will be prompted with the "mysql>"

    When you get Mysql prompt,type the following command :

    Code:
    mysql> set password = password("type_new_password");
    To exit from the monitor type "QUIT"

Similar Threads

  1. Need MySQL database directory
    By Osman84 in forum Software Development
    Replies: 4
    Last Post: 27-02-2010, 05:18 AM
  2. Database Replication in MySQL
    By Muhammad Waqar in forum Software Development
    Replies: 5
    Last Post: 21-12-2009, 12:34 PM
  3. Replies: 3
    Last Post: 07-11-2009, 09:36 PM
  4. Backup mysql database
    By jean-paul martell in forum Software Development
    Replies: 3
    Last Post: 31-10-2009, 01:10 PM
  5. Restoring MySQL database
    By Sean J in forum Software Development
    Replies: 5
    Last Post: 18-02-2009, 01:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,509,328.43615 seconds with 16 queries