Browsed by
Tag: Rapid Fire on MySQL

How to Change a users password from unix shell

How to Change a users password from unix shell

# [mysql dir]/bin/mysqladmin -u username -h hostname.blah.org -p password ‘new-password’ To change a user’s password in MySQL from the MySQL prompt while logged in as the root user, you can use the following steps: To change a MySQL user’s password from the Unix shell, you can use the mysqladmin command. Here’s an example: bash mysqladmin -u <username> -p password <new_password> Replace <username> with the actual username for which you want to change the password, and <new_password> with the desired new…

Read More Read More

How to give user privilages for a db. Login as root. Switch to the MySQL db. Grant privs. Update privs

How to give user privilages for a db. Login as root. Switch to the MySQL db. Grant privs. Update privs

# mysql -u root -p # mysql -u root -p mysql> use mysql; mysql> INSERT INTO user (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES (‘%’,’databasename’,’username’,’Y’,’Y’,’Y’,’Y’,’Y’,’N’); mysql> flush privileges; or mysql> grant all privileges on databasename.* to username@localhost; mysql> flush privileges To give user privileges for a specific database in MySQL, you would typically follow these steps: Login as root: Use the mysql command-line tool to log in as the root user, providing the appropriate credentials. bash mysql -u root -p Switch to the MySQL database:…

Read More Read More