See here for a more up to date account of installing Apache, php, mySQL and phpMyAdmin on Debian.
goto www.../phpmyadmin/setup.php and customise install, you must download file and then upload to config.inc.php file located in ../phpmyadmin/
Choose http authentication means any mysql user can login via http authentication.
SEE *** below re authentication
Initialise installation?
mysql_install_db --user=mysql
to connect from console:
mysql -u root (where user is root with no password)
OR
mysql -u root -p (where you will be prompted for the password)
To create a user:
Choose http authentication means any mysql user can login via http authentication.
SEE *** below re authentication
Initialise installation?
mysql_install_db --user=mysql
Change permissions to allow starting/stopping of server (inc' at boot time)
chmod 775 /etc/rc.d/rc.mysqld
To enable networking, comment out the following line in: /etc/rc.d/rc.mysqld
SKIP="--skip-networking"
Start/stop mySQL
/etc/rc.d/rc.mysqld start
/etc/rc.d/rc.mysqld stop
/etc/rc.d/rc.mysqld stop
to connect from console:
mysql -u root (where user is root with no password)
OR
mysql -u root -p (where you will be prompted for the password)
List all databases:
show databases;
List all users and permissions:
List all users and permissions:
select * from mysql.user;
OR
SELECT user FROM mysql.user;
SELECT user, host FROM mysql.user;
List of all tables in 'Database Name'
SELECT table_name FROM information_schema.tables WHERE table_schema ='Database Name';
Connect to database with mysql -u root (where user is root with no password)
To create a user:
CREATE USER 'neuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'password';
***NOTE:
for access via phpmyadmin, user must be:
'user'@'localhost' and NOT 'user'@'%'
To allow webpage php type stuff to work:
Comment out SKIP="--skip-networking" in /etc/rc.d/rc.mysqld # ENABLE networking.
To create a user:
CREATE USER 'newser'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password';
The following creates a user that can access the database from the network:
To delete a user:
DROP USER 'user'@'localhost'
Some privileges:
ALL PRIVILEGES CREATE DROP DELETE INSERT SELECT UPDATE
last 4 for web client user
To change a user's password;
SET PASSWORD FOR 'user'@'localhost' = PASSWORD('password');
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'password';
***NOTE:
for access via phpmyadmin, user must be:
'user'@'localhost' and NOT 'user'@'%'
To allow webpage php type stuff to work:
Comment out SKIP="--skip-networking" in /etc/rc.d/rc.mysqld # ENABLE networking.
To create a user:
CREATE USER 'newser'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password';
The following creates a user that can access the database from the network:
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
To delete a user:
DROP USER 'user'@'localhost'
Some privileges:
ALL PRIVILEGES CREATE DROP DELETE INSERT SELECT UPDATE
last 4 for web client user
To change a user's password;
SET PASSWORD FOR 'user'@'localhost' = PASSWORD('password');
FLUSH PRIVILEGES;
No comments:
Post a Comment
Note: only a member of this blog may post a comment.