❶ linux安装 mysql如何安装
你也可以先装好ftp服务,这样用起来会比较好点,FTP安装:
yum install vsftpd
1. 启动系统自带的VSFTPD
2.新建一个FTP账号
a. useradd 用户名 -d 文件存放路径 -s /sbin/nologin #/sbin/nologin 表示不能用来作为系统用户登录
b.passwd 用户名 #赋予新账号一个密码
cd /etc/vsftpd 然后 vi /chroot_list #新建一个文档chroot_list 在里面写上 用户名
3.vi /etc/vsftpd/vsftpd.conf
将#chroot_list_enable=YES和#chroot_list_file=/etc/vsftpd/chroot_list 前的#去掉
然后保存退出,重启VSFTPD
修改FTP路径
userdel -R zhougz
useradd -h /var/www/html zhougz
passwd zhougz
可以下载不可以上传(更改文件拥有者)
chown -R 用户:群组 /home/wwwroot(文件路径:就是你上传文件所在的路径)
4.这个时候登录FTP,会出现500 OPS的错误,有两个解决办法。
a.执行setsebool ftpd_disable_trans 1和service vsftpd restart或者直接关闭5.selinux=disabled(默认selinux=enforcing),/etc/selinux/config
b.目录权限问题,比如用户a,目录/ftphome/a
那么/ftphome这个目录属主和组都有读和执行权限,否则也会报500错误。这个也就是部分用户正常,而部分用户不能登录的原因。
***配置完成后记得重启电脑***
添加到防火墙
sudo /sbin/iptables -I INPUT -p tcp --dport 20 -j ACCEPT
sudo /sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT
sudo /etc/rc.d/init.d/iptables save
sudo /etc/rc.d/init.d/iptables restart
开机启动
方法一:
chkconfig vsftpd on service vsftpd start
方法二:
最简单的办法,把service vsftpd start加入/etc/rc.local即可。
从个人使用习惯上来说,chkconfig命令倒是蛮不错的选择.此命令也可以定义其它自动启动服务项次,大家可以试试哦!
进虽ysql解压的源码文件目录
./configure --prefix=/usr/local/mysql #设置mysql的安装路径
make && make install #编译,进行安装。
配置mysql
groupadd mysql #添加mysql组
useradd -g mysql mysql #添加mysql用户并加入到mysql组
cd /usr/local/mysql/ #切换到cd /usr/local/mysql/目录下
chown -R mysql . #改变当前目录下的所有者为mysql用户
chgrp -R mysql . #改变当前目录下的mysql用户的文件为mysql组
cd /usr/local/src/mysql-5.0.22/support-files #到源码mysql目录下的support-files下
cp my-medium.cnf /etc/my.cnf #拷贝文件到/etc/覆盖my.cnf 文件
cd /usr/local/mysql/bin #改变目录到/usr/local/mysql/bin
./mysql_install_db --user=mysql #以mysql身份初始化数据库
cd /usr/local/mysql #改变目录到/usr/local/mysql
chown -R mysql:mysql var #改变var目录所属mysql用户到mysql组
chmod 755 var #改变var目录权限
cd /usr/local/mysql/bin #改变目录到/usr/local/mysql/bin
./mysqld_safe --user=mysql & #以mysql用户启动库生成套接字
netstat -ant | grep 3306 #查看mysql是否启动,mysql用的是3306端口
./mysqladmin -u root password 'admin' #给mysql的root用户设置密码
cd /usr/local/src/mysql-5.0.22/support-files/ #改变目录到cd /usr/local/src/mysql-5.0.22/support-files/
cp mysql.server /etc/init.d/mysqld #拷贝文件用于开机自动启动
chmod 755 /etc/init.d/mysqld #给mysqld权限
chkconfig --add mysqld #添加mysqld服务到系统
chkconfig mysqld on #打开myslqd服务
service mysqld restart #启动mysql服务
测试mysql:
cd /usr/local/mysql/bin #改变目录到cd /usr/local/mysql/bin
./mysql -u root -p #登陆mysql
show databases; #查看数据库表
开机启动2
cp /mysql-5.0.22/support-files/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld //添加到启动
chmod +x /etc/rc.d/init.d/mysqld //添加运行权限
/usr/local/mysql/bin/mysqld_safe --user=mysql &
写入/etc/rc.d/rc.local
开机启动3
chkconfig mysqld on
chkconfig --list mysqld
2-5如果为on就OK
❷ MySQL、linux、python、Debian有什么联系我不能分清楚它们
mysql 是一种数据库,存储数据的
linux 是一种操作系统,相当于另一种windows
python 是一种编程语言,面向对象的那种
debian 也是一种操作系统,使用linux内核
❸ linux mysql密码忘了怎么办
方法一:
#/etc/init.d/mysqlstop
#mysqld_safe--user=mysql--skip-grant-tables--skip-networking&
#mysql-urootmysql
mysql>updateusersetpassword=password(newpassword)whereuser=root;
mysql>flushprivileges;
mysql>quit
#/etc/init.d/mysqlrestart
#mysql-uroot-p
enterpassword:<输入新设的密码newpassword>
mysql>
方法二:
直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:
#mysql-udebian-sys-maint-p
enterpassword:<输入[client]节的密码>
mysql>updateusersetpassword=password(newpassword)whereuser=root;
mysql>flushprivileges;
mysql>quit
#mysql-uroot-p
enterpassword:<输入新设的密码newpassword>
mysql>
❹ debian版本linux下修改mysql密码!
mysqladmin -u帐号 -p当前密码 password "新密码"
❺ linux下mysql密码忘记了怎么办
今天我们主要是讲一下关于linux忘记mysql密码处理方法,下面提供了5种linux忘记mysql密码找回方法哦。
方法一:
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> update user set password=password(newpassword) where user=root;
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
enter password:
mysql>
方法二:
直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:
# mysql -udebian-sys-maint -p
enter password:
mysql> update user set password=password(newpassword) where user=root;
mysql> flush privileges;
mysql> quit
# mysql -uroot -p
enter password:
mysql>
方法三:
这种方法我没有进行过测试,因为我的root用户默认密码已经被我修改过了,那位有空测试一下,把结果告诉我,谢谢!!
# mysql -uroot -p
enter password: etc/mysql/debian.cnf文件中[client]节提供的密码>
方法四:
方法如下: 1, 关闭mysql服务 /etc/init.d/mysqld stop 2,使用 –skip-grant-tables选项启动mysql服务,可以修 改/etc/inin.d/mysqld脚本启动位置增加此选项, vi /etc/init.d/mysqld
方法如下:
1, 关闭mysql服务
/etc/init.d/mysqld stop
2,使用 –skip-grant-tables选项启动mysql服务,可以修 改/etc/inin.d/mysqld脚本启动位置增加此选项,
vi /etc/init.d/mysqld
在下面运行启动的语句里增加--skip-grant-tables
/usr/bin/mysqld_safe --skip-grant-tables --datadir="$datadir" --socket="$socketfile"
--log-error="$errlogfile" --pid-file="$mypidfile"
加入--skip-grant-tables的意思是启动mysql服务的时候跳 过权限表认证。启动后,连接到mysql的root不需要口令
3,重新启动mysql服务
/etc/init.d/mysqld start
4. 修改root用户的密码;
mysql> update mysql.user set password=password(123456) where user=root;
mysql> flush privileges;
mysql> quit
5. 重新启动mysql,就可以使用 新密码登录了。
mysql
mysql -u root –p
输入密码:123456
6,关闭mysql服务
/etc/init.d/mysqld stop
7, 重新修改第2步修改的/etc/init.d/mysqld,使其保持原来不变,也就是取消--skip-grant-tables语句
8,重新 启动mysql服务
/etc/init.d/mysqld start
❻ linux上如何安装mysql5.5
如果是基于Redhat的版本可以以ROOT身份在命令行界面输入:yum install mysql
如果是基于Debian的版本可以以ROOT身份在命令行界面输入:apt-get install mysql
你可以提前更新YUM库:yum update
并不定非要mysql5.5 如果你真要安装这个版本就下载rpm包 然后 rpm -ivh mysql5.5.rpm 来安装
❼ 简述Linux下安装Mysql的过程
进入光盘->进入Server目录->rpm -ivh mysql*
却什么包,自己往里添吧。
你们总拿yum装。他连个mysql都不会装。
你觉得它会配置yum源吗?- -!!! 哎....
❽ 虚拟机中LINUX安装mysql...
给出应急的方式,到光盘的目录下查找mysql服务器软件,
find /mnt/cdrom -type f -name '*mysql-server*'
然后进入对应目录通过rpm来安装:
cd /mnt/cdrom/Server
rpm -ivh *mysql-server*.rpm
不过本人推荐的方式,使用yum安装,这样的话会节省很多时间,因为在你安装mysql,可能会有些软件依赖需要解决。这样的做法也是一劳永逸的。以后你安装软件也会省很多事。
配置方法简单说一下吧:
网上找到对应于red hat9.0yum源的地址(真怀疑有没有)。
然后配置客户端口。
送脚本一个。粘贴运行好了。过程自己看,不细讲了。
#!/bin/bash
# 版权所有,翻录注明出处
# 2009-08-30 01:10:10 edit
echo "Please input the source of the yum(suport ftp http and local path),\nNOTICE the format of path below(Example:file:///home/update):"
read source_path
if [ ! -d "$source_path" ]; then
sed -i 's/gpgcheck=1/gpgcheck=0/' /etc/yum.conf
cd /etc/yum.repos.d/
rm -rf *repo
cat > server.repo <<EOF
[rhel-rpms]
name=Red Hat Enterprise Linux $releasever - $basearch - rpms
baseurl=${source_path}/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-VT]
name=Red Hat Enterprise Linux $releasever - $basearch - VT
baseurl=${source_path}/VT
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
baseurl=${source_path}/Cluster
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - ClusterStorage
baseurl=${source_path}/ClusterStorage
enabled=1
gpgcheck=0
运行脚本,输出源的地址:
如为http源请输入:http://domainname.com/path/
如果为本地源请输入:file:///directory/path
成功运行脚本后。请通过yum install mysql-server来安装mysql服务器。
最后确实建议仁兄,安装一个新版本的red hat来学习,redhat 9.0的多少人都不用了,至少也是5版本才好吧。
❾ Linux怎么查看软件安装路径 查看mysql安装在哪
不同的linux版本查看mysql安装路径的方法略有不同,这里以debian系列的linux发行版和redhat系列的linux发行版为例,简要说明其查询方法,仅供参考。
一、redhat系列的查询方法
1、查询mysql服务端安装的路径。
rpm-qlmariadb-server
或者
rpm-qlmysql-server
说明:mysql被oracle收购了,现在开源版本为mariadb,rpm是redhat系列
linux发行版本的包管理程序,-ql是其参数,-q是查询,-l是列出安装文件。
后面接的是mysql的服务端。
❿ 如何在Linux下安装mysql,我第一次用linux系统,虚拟机下装的ubuntu10.0.4,请高手指点,最好能详细一点
同学,ubuntu是debian系的操作系统,不是这样用的。rpm是redhat系的包管理工具。
你尝试这样做:
$ su -
切换到超级用户
# apt-cache search mysql-server
这个是查找 mysql 相关的包。
# apt-get install mysql-server-5.1
这个是安装。前提你的电脑可以上网,且nameserver配置正确。
你先apt-get update
update后, apt-cache search mysql-server.
确认有那个包,再apt-get install mysql-server-5.xxx
另外,站长团上有产品团购,便宜有保证