Welcome back to shortlearner.com, in our previous post we will see how to install WordPress in CentOS. In this post today we will see how to fix the unable to create directory error in WordPress.
so i recently i was working on a WordPress based project so when i try to upload/import media into WordPress’s media library then i got some kind of error ,which are mentioned below. this tutorial is for you. It will show you how to fix this annoying error.
Welcome back to shortlearner.com, in our previous post we learn How to Install PHP on CentOS. now today in this post we will see how to install MySQL on CentOS. before going to installation process we just take an overview of CentOS and MySQL.
CentOS is a Community Enterprise Operating System. It is an open-source platform for non-productive developmental work. For production concern, those works can be migrated to RHEL (Red Hat Enterprise Linux) Linux distribution platform.
MySQL open-source tool and Database Management System. MySQL is a fast, stable, true multi-user, multi-threaded SQL database server. Apart from the free edition, MySQL also offers other services like MySQL Enterprise Edition, MySQL Cluster CGE, Oracle MySQL Cloud Service and MySQL for OEM/ISV.
Now the MySQL 8.0 Repository Package got enabled in the CentOS. We can directly install the package using below mentioned command.
sudo yum install mysql-community-server
don’t forgot to verify the signature key , it is the most important thing to do. For a specific package, we need to obtain a copy of public GPG build key. While installation it will be asked for key permission.so just type Y and hit the enter button.
sudo yum install mysql-community-server
After installation of MySQL:
1) Enabling the MySQL Service:
so the steps are mentioned below is same for any version of MySQL. so just follow the below steps one by one.
First , we need to enable mysqld . which will help to run the MySQL package in background during the boot time. Use below command for enabling the server.
sudo systemctl enable mysqld
after enabling the server we need to start the server for the connectivity by using the below command.
sudo systemctl start mysqld
now we need to check with the status of the server for its operating status. we can use below command to check the status in the output terminal – Status: SERVER_OPERATING
sudo systemctl status mysqld
2) Securing your Credentials:
For the first time when we start with our MySQL server, we will have default password in the MySQL server root user. we can locate the default password by using below command.
sudo grep'temporary password'/var/log/mysqld.log
In the output our default password will be displayed. Remember the default password, will will help to login in further steps.
To enhance the security of the MySQL installation, use below command
When we execute the above command, it will be asked for a password. we need to enter our password there.
After this, we need to enter our own password. For secure password: 8 Char length, 1 upper case, 1 lowercase, 1 special character, and 1 Numeric char. Now the MySQL server will ask some questions regarding Access, User Permission, remove the database. so just type Y and hit the enter button for all questions.
3) Login Setup to Your MySQL Server:
We all set with our credentials , we are ready to login to the MySQL Server. For that we need to enter into the root of MySQL server. we can enter below command to get into the root.
Once we entered into the root, we will be asked for our own password, which we created in previous steps.
4) Database and Table Creation:
We all set with the MySQL server. To create the database, we can use below command.
Mysql>CREATE DATABASE new_database;
We created our database, now we can get into our database using the following command.
so first of all we should take an overview of our working scenario. in the below code we are created a form with having email, subject,message and attachment fields.
once the form is submitted our script is check that the file’s format is valid or not. if the file format is valid than the attachment is concatenate with our message field and with the help of MIME (Multipurpose Internet Mail Extensions) version and its content type and boundary.
we will send the attachment. once the mail is send successfully our script will display the success message and if the mail isn’t sent than it will display failure message as well.
before start this tutorial first of all we should understand the overall scenario of this post. now first of all we need to create a database connection , so in this example my database name is testdb .
after creating a database connection we fetch all the records from our user table and designed it in a tabular format with checkbox field, and also create a java script function that will help us to select all check boxes at a time. so just follow the below code.