Select your language


<-
Idioma - Language - Idioma - भाषा (Bhāṣā) - 语言 (Yǔyán)

SERVER COMMANDS - mysql - Ubuntu 24.04 LTS
Learn more about this image by clicking here.

Only tested and working commands are here. Used in

Ubuntu 24.04 LTS

The key for single quotes is --> ' <-- it is mandatory. It's located on the keyboard to the left of the number key1. For some reason, some article editors tend to replace it with a custom type of quote. If this happens, type it again instead of copying it.

In the already installed SQL

To delete a user

DROP USER 'username'@'localhost';

To view existing users (useful to see if the user was actually deleted)

SELECT user FROM mysql.user;

To view existing users and their hosts

SELECT user, host FROM mysql.user;

To create a user

CREATE USER 'silvio_uphpmy'@'localhost' IDENTIFIED BY 'passwordhere';

To check a user's permissions

SHOW GRANTS FOR 'username'@'localhost';

If you want to grant all privileges to a user on the database, use the following code:

GRANT ALL PRIVILEGES ON mydatabase.* TO 'username'@'localhost';

To grant permissions for all databases, it is

GRANT ALL PRIVILEGES ON *. * TO ‘username’@’localhost’;

I used localhost because it's the default. Only advanced users should use something different, as they will naturally have to edit the hosts.

To view existing databases.

SHOW DATABASES;

.

 

Deixe seu comentário - Leave a comment - Deja tu comentario - 发表评论 - अपनी टिप्पणी छोड़ें

O editor não se responsabiliza pelos comentários registrados aqui., El editor no se hace responsable de los comentarios registrados aquí., The editor is not responsible for the comments registered here., 编辑不对此处记录的评论负责。, संपादक यहाँ दर्ज की गई टिप्पणियों के लिए जिम्मेदार नहीं है।

Número de celular e e-mail não irão aparecer na internet, El número de móvil y el correo electrónico no aparecerán en internet, Mobile number and email will not appear on the internet, 手机号码和电子邮箱不会出现在互联网上, मोबाइल नंबर और ईमेल इंटरनेट पर दिखाई नहीं देंगे.

Seja o primeiro a escrever um comentário.