Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install jdk and mysql in centos

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to install jdk and mysql in centos". In daily operation, I believe many people have doubts about how to install jdk and mysql in centos. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to install jdk and mysql in centos". Next, please follow the editor to study!

One: environment

Second: download the rpm package of jdk locally and upload it to the server (because I just started to use wget to download directly to the server, and the installation keeps reporting errors, so I decided to use this stupid method)

Download address:

Jdk is installed in / usr/java by default

Three: configure environment variables

My machine can perform java-version operations normally without configuring environment variables after installing jdk-8u151-linux-x64.rpm, so I did not configure jdk environment variables. However, for future discomfort, here is a record of how to configure it, as follows:

Modify the system environment variable file

Vi / etc/profile

Append the following to the file:

Java_home=/usr/java/jdk1.8.0_151

Jre_home=/usr/java/jdk1.8.0_151/jre

Path=$path:$java_home/bin:$jre_home/bin

Classpath=.:$java_home/lib/dt.jar:$java_home/lib/tools.jar:$jre_home/libexport java_home jre_home path classpath

Make the changes effective

[root@localhost ~] # source / etc/profile / / make the changes take effect immediately [root@localhost ~] # echo $path / / check the path value

View the status of the system environment

[root@localhost ~] # echo $path/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jdk1.8.0_25/bin:/usr/java/jdk1.8.0_25/jre/bin

4: install mysql (download and install mysql-server on the official website)

# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm# rpm-ivh mysql-community-release-el7-5.noarch.rpm# yum install mysql-community-server

Restart the mysql service after successful installation.

# service mysqld restart

The initial installation of the mysql,root account does not have a password.

Set password

Mysql > set password for 'root'@'localhost' = password (' password'); query ok, 0 rows affected (0.00 sec) mysql >

Five: configure mysql

1. Coding

The mysql configuration file is / etc/my.cnf

Finally, add the coding configuration.

[mysql] default-character-set = utf8

The character encoding here must be the same as in / usr/share/mysql/charsets/index.xml.

2. Remote connection settings

Assign all permissions on all tables in all databases to root users at all ip addresses.

Mysql > grant all privileges on *. * to root@'%'identified by 'password'

If it is a new user instead of root, create a new user first

Mysql > create user 'username'@'%' identified by' password'

At this point, you can connect remotely.

At this point, the study on "how to install jdk and mysql in centos" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report