永发信息网

linux怎么删除mysql库

答案:2  悬赏:70  手机版
解决时间 2021-11-28 13:15
linux怎么删除mysql库
最佳答案
和win一样
全部回答
创建用于执行mysql服务程序的帐号: [root@linuxprobe cmake-2.8.11.2]# cd .. [root@linuxprobe src]# useradd mysql -s /sbin/nologin 创建数据库程序和文件的目录,并设置目录的所属与所组: [root@linuxprobe src]# mkdir -p /usr/local/mysql/var [root@linuxprobe src]# chown -rf mysql:mysql /usr/local/mysql 安装mysql服务程序(解压与编译过程已省略): [root@linuxprobe src]# tar xzvf mysql-5.6.19.tar.gz [root@linuxprobe src]# cd mysql-5.6.19/ [root@linuxprobe mysql-5.6.19]# cmake . -dcmake_install_prefix=/usr/local/mysql -dmysql_datadir=/usr/local/mysql/var -dsysconfdir=/etc [root@linuxprobe mysql-5.6.19]# make [root@linuxprobe mysql-5.6.19]# make install 删除系统默认的配置文件: [root@linuxprobe mysql-5.6.19]# rm -rf /etc/my.cnf 生成系统数据库(生成信息已省略): [root@linuxprobe mysql-5.6.19]# cd /usr/local/mysql [root@linuxprobe mysql]# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var 创建配置文件的软连接文件: [root@linuxprobe mysql]# ln -s my.cnf /etc/my.cnf 将mysqld服务程序添加到开机启动项: [root@linuxprobe mysql]# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld [root@linuxprobe mysql]# chmod 755 /etc/init.d/mysqld [root@linuxprobe mysql]# chkconfig mysqld on 编辑启动项的配置文件: [root@linuxprobe mysql]# vim /etc/rc.d/init.d/mysqld //分别修改第46与47行,basedir为程序安装路径,datadir为数据库存放目录。 basedir=/usr/local/mysql datadir=/usr/local/mysql/var 重启mysqld服务程序: [root@localhost mysql]# service mysqld start starting mysql. success! 把mysql服务程序命令目录添加到环境变量中(永久生效): [root@linuxprobe mysql]# vim /etc/profile //在配置文件的最下面追加: export path=$path:/usr/local/mysql/bin [root@linuxprobe mysql]# source /etc/profile 将mysqld服务程序的库文件链接到默认的位置: [root@linuxprobe mysql]# mkdir /var/lib/mysql [root@linuxprobe mysql]# ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql [root@linuxprobe mysql]# ln -s /usr/local/mysql/include/mysql /usr/include/mysql [root@linuxprobe mysql]# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock 初始化mysqld服务程序: [root@linuxprobe mysql]# mysql_secure_installation note: running all parts of this script is recommended for all mysql servers in production use! please read each step carefully! in order to log into mysql to secure it, we'll need the current password for the root user. if you've just installed mysql, and you haven't set the root password yet, the password will be blank, so you should just press enter here. enter current password for root (enter for none): ok, successfully used password, moving on... setting the root password ensures that nobody can log into the mysql root user without the proper authorisation. set root password? [y/n] y new password: 输入要为root用户设置的数据库密码。 re-enter new password: 重复再输入一次密码。 password updated successfully! reloading privilege tables.. ... success! by default, a mysql installation has an anonymous user, allowing anyone to log into mysql without having to have a user account created for them. this is intended only for testing, and to make the installation go a bit smoother. you should remove them before moving into a production environment. remove anonymous users? [y/n] y(删除匿名帐号) ... success! normally, root should only be allowed to connect from 'localhost'. this ensures that someone cannot guess at the root password from the network. disallow root login remotely? [y/n] y(禁止root用户从远程登陆) ... success! by default, mysql comes with a database named 'test' that anyone can access. this is also intended only for testing, and should be removed before moving into a production environment. remove test database and access to it? [y/n] y(删除test数据库并取消对其的访问权限) - dropping test database... ... success! - removing privileges on test database... ... success! reloading the privilege tables will ensure that all changes made so far will take effect immediately. reload privilege tables now? [y/n] y(刷新授权表,让初始化后的设定立即生效) ... success! all done! if you've completed all of the above steps, your mysql installation should now be secure. thanks for using mysql! cleaning up... 可以百度搜索linux就该这么学,第9章 使用apache服务部署静态网站,里面有部署mysql的资料
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
银行存款8万存3年定期和3年活期利息多少?
砖厂烟气脱硫塔用pp板做可以吗
抗渗混凝土和微膨胀混凝土一样吗
工资3800扣完五险一金
3dma激活码
咸丰十年圣旨值多少钱
如何补出半命题作文新颖深刻的题目
有邪气是什么意思
翻译~~~~~~
单选题下列关于我国气候类型的叙述,正确的是
人生安年龄分7个阶段吗
各位,索尼xba a3和jvc fx850哪个低频更好
亚麻色和金铜色可以混在一起染发?
钟祥市金福米厂地址有知道的么?有点事想过去
作文题目:造脸需谨慎
推荐资讯
如图是一个正方体的平面展开图,若该正方体相
十六年工龄退休拿多少工资
我电脑128g不够怎么办再装一个机械硬盘吗,50
女孩取名付语希溪夕汐兮曦哪个好
--How are your business goes wrong? ---But
陈学冬的家庭背景
2010年1月,中国银监会正式批准3家银行筹建消
排卵期高温10天能有怀孕有可能吗
桂林公积金贷款,需要多久时间
我今年二十岁,这句话用日语怎么写,给个正确
渗碳淬火HRc58一62度怎么校直合适,谢谢!
苹果8型号MQ6M2CH/A1863序列号F4GX3YMUJC
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?