Tuesday, November 6, 2007

Mysql Admin

Note:
To login into Northbeach server use
username as root and password
and for all other servers username and password is same as plesk login info
===============================================
mysql path
/var/lib/mysql

===================================
Restart mysql

/etc/rc.d/init.d/mysql stop
/etc/rc.d/init.d/mysql start


===================================
mysql -u TYPEUSERNAMEHERE -p

username is "admin" (same as plesk) and password "chtnta0e" (plesk password)

=========================================
Grant previligaes and enable remotehost login etc.
Always use this one
GRANT ALL PRIVILEGES ON bCo.* TO nan@'%' IDENTIFIED BY 'weenie';
bCo is Databse name
nan is username
weenie is password
so in general form

GRANT ALL PRIVILEGES ON dbname.* TO username@'%' IDENTIFIED BY 'password';

===============================
Solutiuon
Posted by [name withheld] on December 30 2003 1:15pm [Delete] [Edit]

Your second example, in which you claim MySQL is wrong in their documentation, will not work because you are trying to use a backquote (`) instead of the single quote ('). They look similar but are completely different. Thus your example:

GRANT ALL PRIVILEGES ON testData.* TO jts@'%' IDENTIFIED BY 'lwr5021' WITH GRANT OPTION;

does not work because nan@'%` is not properly quoted. It should read nan@'%' instead which is fine. This works as expected:

GRANT ALL PRIVILEGES ON bCo.* TO nan@'%' IDENTIFIED BY 'weenie' WITH GRANT OPTION;


Posted by Mike Barrett on January 7 2004 10:52am [Delete] [Edit]

I wanted to create a use who can

1) login with a password either locally or from within our local 10.*.*.* network

2) do anything they want to their own database

3) see what other databases are on the server, but not do anything to them (to facilitate requests for additional access).

This seemed to do the trick:
GRANT SHOW DATABASES ON *.* TO hubert@localhost IDENTIFIED BY 'password';
GRANT SHOW DATABASES ON *.* TO hubert@'10.%' IDENTIFIED BY 'password';
GRANT ALL ON hubertsdb.* TO hubert;

==============================================
Reset or set password

SET PASSWORD FOR 'mynewuser'@'localhost' = PASSWORD('newpwd');


====================================================
Create Database
Log into Mysql as root:

mysql -u root -p

(On a Windows server, go start>>run type "command", and it is d:\mysql\bin\mysql -u root -p')

2. Create the database:

create database DATABASENAME;

3. Create the user and grant privileges for the database:

grant select,insert,update,delete,create,drop,alter on DATABASENAME.* to MYSQLUSERNAME@'%' identified by 'PASSWORD';

4. Send new MySQL database email to customer.


=======================================================
To Administrar the mysql processes
Logged in to mysql as root:

show processlist;

Or not logged into mysql, to get a running view:

watch mysqladmin processlist -u admin -pPASSWRD
==================================================

To flush the cache command is :

mysqladmin flush-hosts -uadmin -pchtnta0e



No comments:

Blog Archive