一:环境
二:下载jdk的rpm包到本地,上传到服务器(因为这块我刚开始使用wget直接下载到服务器,安装不断报错,所以我决定使用这种笨办法)
下载地址:
jdk默认安装在/usr/java中
三:配置环境变量
我的机器安装完jdk-8u151-linux-x64.rpm后不用配置环境变量也可以正常执行java –version操作,因此我没有进行jdk环境变量的配置。但是为了以后的不适之需,这里还是记录一下怎么进行配置,操作如下:
修改系统环境变量文件
vi /etc/profile
向文件里面追加以下内容:
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
使修改生效
[root@localhost ~]# source /etc/profile //使修改立即生效 [root@localhost ~]#echo $path //查看path值
查看系统环境状态
[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
四:安装mysql(官网下载安装mysql-server)
# 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
安装成功后重启mysql服务。
# service mysqld restart
初次安装mysql,root账户没有密码。
设置密码
mysql> set password for 'root'@'localhost' =password('password'); query ok, 0 rows affected (0.00 sec) mysql>
五:配置mysql
1、编码
mysql配置文件为/etc/my.cnf
最后加上编码配置
[mysql] default-character-set =utf8
这里的字符编码必须和/usr/share/mysql/charsets/index.xml中一致。
2、远程连接设置
把在所有数据库的所有表的所有权限赋值给位于所有ip地址的root用户。
mysql> grant all privileges on *.* to root@'%'identified by 'password';
如果是新用户而不是root,则要先新建用户
mysql>create user 'username'@'%' identified by 'password';
此时就可以进行远程连接了。
以上是centos如何安装jdk及mysql的详细内容。更多信息请关注PHP中文网其他相关文章!

mysqloffersvariouscharactersetsforstringdatatypes:1)latin1 forwesterneuropeanlanguages,2)utf8 formultingualsupport,3)utf8mb4f OREXTEDENDENDENENICODECLUDINGEMOJIS,4)UCS2FORIXED-WIDTHENCODING,5)assiiforbasiclatin.ChoosideStherightStetSetensensersdaintegrity

流式传输BLOB确实比直接存储更好,因为它能减少内存使用和提高性能。1)通过逐步读取和处理文件,避免了数据库膨胀和性能下降。2)流式传输需要更复杂的代码逻辑,且可能增加I/O操作次数。

mySqlStringTypesimpactStorageAndPerformanCeaseAsfollows:1)长度,始终使用theSamestoragespace,whatcanbefasterbutlessspace-felfficity.2)varCharisvariable varcharisvariable length,morespace-morespace-morespace-effficitybuteftife buteftife butfority butfority textifforlyslower.3)

mySqlStringTypesIncludeVarChar,文本,char,enum和set.1)varCharisVersAtileForvariable-lengthStringStringSuptOptoPeptoPepecifientlimit.2)textisidealforlargetStortStorStoverStorextorewiteWithoutAdefinedLengthl.3)charlisfixed-Length

MySQLoffersvariousstringdatatypes:1)CHARforfixed-lengthstrings,2)VARCHARforvariable-lengthtext,3)BINARYandVARBINARYforbinarydata,4)BLOBandTEXTforlargedata,and5)ENUMandSETforcontrolledinput.Eachtypehasspecificusesandperformancecharacteristics,sochoose

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

toadduserInmysqleffectection andsecrely,theTheSepsps:1)USEtheCreateuserStattoDaneWuser,指定thehostandastrongpassword.2)GrantNectalRevileSaryPrivilegesSustate,usiveleanttatement,AdheringTotheTeprinciplelastPrevilegege.3)

toaddanewuserwithcomplexpermissionsinmysql,loldtheSesteps:1)创建eTheEserWithCreateuser'newuser'newuser'@''localhost'Indedify'pa ssword';。2)GrantreadAccesstoalltablesin'mydatabase'withGrantSelectOnMyDatabase.to'newuser'@'localhost';。3)GrantWriteAccessto'


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

记事本++7.3.1
好用且免费的代码编辑器

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境