Answers for "sql create user"

SQL
2

sql create user

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
# Some PHP versions may have issues with the above statement
# use the older mysql_native_password plugin instead:
CREATE USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
# Give access to all databases with all privileges like root user
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
# Give access to SPECIFIC database with all privileges
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
# when done, flush privileges.
FLUSH PRIVILEGES;
Posted by: Guest on October-19-2021
16

create user mysql

CREATE USER 'norris'@'localhost' IDENTIFIED BY 'password';
Posted by: Guest on March-07-2020
2

create user sql server

/*You can also create a login using the T-SQL command.*/
CREATE LOGIN MyLogin WITH PASSWORD = '123';
Posted by: Guest on December-04-2020
2

psql create user

# https://www.postgresql.org/docs/8.0/sql-createuser.html
CREATE USER <username> WITH PASSWORD '<password>' VALID UNTIL '<date here>';
Posted by: Guest on April-08-2020
1

create user sql

-- Creates the login AbolrousHazem with password '340$Uuxwp7Mcxo7Khy'.  
CREATE LOGIN username   
    WITH PASSWORD = 'password';  
GO  

-- Creates a database user for the login created above.  
CREATE USER AbolrousHazem FOR LOGIN AbolrousHazem;  
GO
Posted by: Guest on July-14-2020
0

sql create user

-- Step 1: Create a new user with a password
CREATE USER 'new_username'@'localhost' IDENTIFIED BY 'secure_password';

-- Alternate method: Use mysql_native_password for compatibility with older systems
CREATE USER 'new_username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'secure_password';

-- Step 2: Grant specific privileges to the user for a database
GRANT ALL PRIVILEGES ON database_name.* TO 'new_username'@'localhost';

-- OR: Grant all privileges on all databases (root-like privileges)
GRANT ALL PRIVILEGES ON *.* TO 'new_username'@'localhost' WITH GRANT OPTION;

-- Step 3: Apply changes
FLUSH PRIVILEGES;

-- (Optional) Test the new user by logging in
-- Run this command in the terminal:
-- mysql -u new_username -p
Posted by: Ritik Raj on November-30-2024
0

sql create user Guide

-- Create a new user with a password
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'password';

-- Grant specific privileges to the user on a particular database
GRANT SELECT, INSERT, UPDATE, DELETE ON database_name.* TO 'new_user'@'localhost';

-- To grant all privileges on the database
GRANT ALL PRIVILEGES ON database_name.* TO 'new_user'@'localhost';

-- If you want the user to have global privileges (use with caution)
GRANT ALL PRIVILEGES ON *.* TO 'new_user'@'localhost' WITH GRANT OPTION;

-- Save changes to privileges
FLUSH PRIVILEGES;

-- You can now log in as the new user
-- mysql -u new_user -p
Posted by: Ritik Raj on December-02-2024

Code answers related to "SQL"

Browse Popular Code Answers by Language