linux jdk1.7 tomcat mysql_centos7安装JDK1.7+tomcat7+mysql5.5

-DENABLED_LOCAL_INFILE=1 \

-DWITH_EXTRA_CHARSETS=all \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DWITH_SSL=yes

[root@localhost ~]make .

[root@localhost ~]#make

[root@localhost ~]#make install

# End of source-build specific instructions

# Postinstallation setup

shell> cd /usr/local/mysql

shell> chown -R mysql.mysql /usr/local/mysql

[root@localhost mysql]# scripts/mysql_install_db --user=mysql

Installing MySQL system tables...

OK

Filling help tables...

OK

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'

./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:

./bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default. This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

shell> cp support-files/my-medium.cnf /etc/my.cnf

shell> bin/mysqld_safe --user=mysql &

# Next command is optional

//查看MYSQL是否正常启动

[root@localhost mysql]# ps -ef|grep mysql

root 12381 2182 0 17:21 pts/0 00:00:00 /bin/sh bin/mysqld_safe --user=mysql

mysql 12637 12381 0 17:21 pts/0 00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/dbdata --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/dbdata/localhost.localdomain.err --pid-file=/data/dbdata/localhost.localdomain.pid --socket=/usr/local/mysql/tmp/mysql.sock --port=3306

root 12706 2236 0 18:45 pts/1 00:00:00 grep mysql

shell> cp support-files/mysql.server /etc/init.d/mysql.server

[root@localhost ~]# chmod +w /usr/local/mysql

[root@localhost ~]# chown -R mysql:mysql /usr/local/mysql #改变目录拥有者与所属组

[root@localhost ~]# ln -s /usr/local/mysql/lib/libmysqlclient.so.16 /usr/lib/libmysqlclient.so.16

[root@localhost ~]# cd support-files/

[root@localhost ~]# cp my-large.cnf /etc/my.cnf # 选择默认 配置文件 适合大型服务器

[root@localhost ~]# cp mysql.server /etc/init.d/mysqld # 复制启动文件

将 mysql 加入开机启动

[root@localhost ~]# chmod +x /etc/init.d/mysqld

[root@localhost ~]# vi /etc/init.d/mysqld (编辑此文件,查找并修改以下变量内容:)

basedir=/usr/local/mysql

datadir=/var/mysql/data

[root@localhost ~]# chkconfig --add mysqld

[root@localhost ~]# chkconfig --level 345 mysqld on

启动 mysql

[root@localhost ~]# service mysqld start

给mysql设置密码,mysql默认密码为空

通过登录mysql系统,

#mysql -uroot -p

Enter password: 【输入原来的密码】默认密码为空,直接按回车键

mysql>use mysql;

mysql>update user set password=passworD("test") where user='root';

mysql>flush privileges;

mysql>exit;

mysql安装好,默认没有打开远程访问,下面打开远程访问方法

通过登录mysql系统,

#mysql -uroot -p

Enter password: 输入密码成功登录后

mysql>use mysql;

mysql>update user set host = '%' where user = 'root';

mysql>select host, user from user;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值