1/11/2024 0 Comments Create database mysql ubuntu![]() ![]() use below command, mysql> CREATE USER IDENTIFIED BY as you can see in above command, new database user name is devopsarticle and password for this user is you can choose yours accordingly. Now, we have to create a user with full previlage to access this database. Now, use below command to create new database, (replace dev_database with your database name) mysql> CREATE DATABASE dev_database Use below command using root previlage to open MySQL. To create MySQL database it’s required user permission, unless you just use the root account which not recommended, here we’ll create user and database. #sudo ufw allow from any to any port 3306 proto tcp Step.3 Create MySQL Database Use below command to allow MySQL port 3306 in Ubuntu’s firewall. Use can see the status as in below images, You can now restart and enable MySQL services to take effect and boot automatically, use below commends, #sudo systemctl restart mysql Then change the bind-address line to 0.0.0.0instead of 127.0.0.1 Then save the file. It will open mysqld.cnf file #sudo nano /etc/mysql//mysqld.cnf Use below command to allow remotely access. By default for security reason MySQL database is accessible only from locally. ![]() In case, you need to access MySQL server remotely then you have to allow it. Also set strong password for root along with disable remote login for root. Now, after used above command, it will ask you few questions, you can answered this questions and choose most appropriate and secured settings. Now, its very very important to secure mysql server, use below command for this, #sudo mysql_secure_installation Use below commands to install package MySQL server #sudo apt install mysql-server If you want to build your own database server then you have to install “MySQL Server” package, once it installed you can access your database server locally or you can access it externally using MySQL client. Mysql Ver 8.0.19-0ubuntu4 for Linux on x86_64 ((Ubuntu)) Step.2 Install MySQL Server Use below command to check it, and will see the results as below, #mysql -V Open your terminal and use below command, #sudo apt install mysql-client
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |