Activity Stream
48,167 MEMBERS
62237 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 3 of 3
  1.     
    #1
    Member
    Website's:
    AVANETCO.COM AVAVPS.COM

    Default Working with mysql-(1)

    Create mysql database

    To create database,



    PHP Code: 
    create database DB_NAME 
    For example


    PHP Code: 
    mysqlcreate database video_vshare
    Query OK1 row affected (0.01 sec

    mysql



    Creating mysql user account

    To create a mysql user with all privileges on all databases.


    PHP Code: 
    GRANT ALL ON *.* TO 'USER_NAME'@'localhost' IDENTIFIED BY 'PASSWORD_HERE'
    GRANT ALL ON *.* TO 'USER_NAME'@'%' IDENTIFIED BY 'PASSWORD_HERE';  
       
    Create a user with permission to only one database
    PHP Code: 
    GRANT ALL ON DB_NAME.* to 'USER_NAME'@'localhost' IDENTIFIED BY 'PASSWORD_HERE'




    Create MySQL User who can only Manage His Own DB

    PHP Code: 
    grant create on *.* to 'user'@'localhost' identified by 'pass'
    FLUSH PRIVILEGES 
    Repair mysql table

    To repair table, you use to use the database.

    PHP Code: 
    mysql 
    use freebb 
    Now to check a table.
    PHP Code: 
    mysqlcheck table mithridates_sessions
    +-----------------------------+-------+----------+----------------------------------------------------------+ 
    Table                       Op    Msg_type Msg_text                                                 
    +-----------------------------+-------+----------+----------------------------------------------------------+ 
    mithridates_sessions check warning  Table is marked as crashed                               
    mithridates_sessions check warning  6 clients are using or havent closed the table properly 
    mithridates_sessions check error    Record at pos9519 is not remove-marked                 
    mithridates_sessions check error    record delete-link-chain corrupted                       
    mithridates_sessions check error    Corrupt                                                  
    +-----------------------------+-------+----------+----------------------------------------------------------+ 
    5 rows in set (0.05 sec)  
       
    We found the table Corruptso repair it with repair table command.
         
    PHP Code:      mysqlrepair table mithridates_sessions
    +-----------------------------+--------+----------+--------------------------------------+ 
    Table                       Op     Msg_type Msg_text                             
    +-----------------------------+--------+----------+--------------------------------------+ 
    mithridates_sessions repair warning  Number of rows changed from 94 to 95 
    mithridates_sessions repair status   OK                                   
    +-----------------------------+--------+----------+--------------------------------------+ 
    2 rows in set (0.17 sec

    mysql
    Albert.Nawaro Reviewed by Albert.Nawaro on . Working with mysql-(1) Create mysql database To create database, create database DB_NAME For example Rating: 5

  2.   Sponsored Links

  3.     
    #2
    ψ(`∇?)ψ
    Awesome, please, continue!


  4.     
    #3
    Member
    Website's:
    hostingmates.com
    you can use the following useful mysql commands

    Command to dump the mysql database
    mysqldump database_name > database_name.sql

    To restore a DB from backup
    mysql database_name < database_name.sql

    To delete a mysql database
    mysqladmin drop database_name

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Working with mysql-(3)
    By Albert.Nawaro in forum Server Management
    Replies: 0
    Last Post: 20th Feb 2012, 09:26 AM
  2. Working with mysql-(2)
    By Albert.Nawaro in forum Server Management
    Replies: 0
    Last Post: 20th Feb 2012, 09:23 AM
  3. MYSQL Error while Import via MYSQL Dumper (Error
    By desibreaker in forum Server Management
    Replies: 10
    Last Post: 5th Aug 2011, 07:26 PM
  4. MySQL help
    By kos in forum vBulletin
    Replies: 4
    Last Post: 29th Jun 2011, 12:30 PM
  5. DLE MySQL help
    By John in forum Webmaster Discussion
    Replies: 4
    Last Post: 17th May 2011, 06:51 PM

Tags for this Thread

BE SOCIAL