Ubuntu18.10 server版 安装Mysql

1、更新软件列表

sudo apt-get update

2、安装mysql-server

sudo apt-get install mysql-server

3、安装后进行配置,注意下面标红处Y/N;

sudo mysql_secure_installation

root@ubuntuserver:~# sudo mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: N
Please set the password for root here.

New password:

Re-enter new password:
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? (Press y|Y for Yes, any other key for No) : N

 ... skipping.


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? (Press y|Y for Yes, any other key for No) : Y
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? (Press y|Y for Yes, any other key for No) : N

 ... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
Success.

All done!

4、登录
momo@ubuntuserver:~$ sudo mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.25-0ubuntu0.18.10.2 (Ubuntu)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

### Ubuntu 18.10 配置与问题解决 #### 软件源的更改 为了优化软件更新速度以及减少潜在冲突,可以调整Ubuntu系统的软件源。通过点击桌面左上方的“软件和更新”,进入设置界面后选择合适的镜像站点作为新的软件源[^2]。 #### 解决 `install-snap` 错误 如果遇到 `has install-snap change in progress` 的错误提示,可以通过强制停止正在进行的任务来解决问题。具体命令如下: ```bash sudo snap changes sudo snap abort <change-id> ``` 上述命令用于查询当前正在运行的任务列表,并终止指定ID的任务。这通常能够有效清除阻塞状态[^1]。 #### NVIDIA GPU驱动验证 对于需要配置NVIDIA显卡支持的情况,在完成驱动程序安装之后,应当执行以下指令确认其正常工作: ```bash nvidia-smi ``` 当终端返回有关GPU的信息而非错误消息时,则表明安装过程无误;反之则建议重启设备再次尝试检测硬件连接状况。 #### 声音插件缺失修复方案 部分场景下可能会遭遇音频功能受限的现象,此时需额外部署32位架构下的声音组件库以弥补兼容性缺陷: ```bash sudo apt update && sudo apt install libasound2-plugins:i386 ``` 此操作有助于恢复完整的多媒体体验效果[^3]。 #### Code::Blocks 开发环境搭建指南 由于官方仓库暂时缺乏直接适配于Ubuntu 18.10本的预编译二进制包,所以有两种可行途径实现IDE引入目标: - **方法一**: 访问Code::Blocks官方网站获取最新压缩档资料(`codeblocks_17.12-1_amd64_stable.tar.xz`)并依照说明文档逐步解析依赖关系进而实施本地构建流程; - **方法二**: 利用第三方PPA资源池补充所需材料(尽管目前仅覆盖至Ubuntu 18.04),即按照常规APT机制导入外部存储库链接地址完成自动化装配作业[^4]: ```bash sudo add-apt-repository ppa:pasgui/ppa sudo apt-get update sudo apt-get install codeblocks ``` #### Docker 数据共享实践案例分析 假设存在跨平台协作需求或者希望简化开发调试环节的操作复杂度,那么借助Docker技术框架无疑是明智之举之一。下面展示了一个典型实例——如何将宿主操作系统上的特定路径映射给虚拟容器内部使用以便同步访问文件数据集: ```bash # 初始化挂载点位置 sudo mkdir /usr/local/test # 构建带持久化卷绑定的新容器实体 sudo docker run -di \ -v /usr/local/test:/usr/local/test \ --name=mycentos3 centos:7 # 测试交互模式切换至目标空间内核上下文中去探索关联区域是否存在预期对象项 sudo docker exec -it mycentos3 /bin/bash ls /usr/local/test/ ``` 以上脚本片段清晰地阐述了整个端到端解决方案的设计思路及其实际应用场景价值体现方式[^5]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值