启东的个人博客 - mariadb
type: channel
link: https://echo.solo90.com/tag/mariadb/
items: 无法重设MySQL（MariaDB）root密码 -Can’t reset MySQL (MariaDB) root password
items: MariaDB的yum安装方式的简单配置
items: Elementary os 0.4 安装环境

无法重设MySQL（MariaDB）root密码 -Can’t reset MySQL (MariaDB) root password
type: item
date: 2018-01-04T13:40:00+00:00
description: 我自己配置服务器环境的时候安装MariaDB 装完后无法连接Cannot log in to the MySQL server.解决办法MariaDB [mysql]> SELECT user, plugin FROM user; +------+-------------+ | user | plugin | +------+-------------+ | root | unix_socket | | root | unix_socket | | root | unix_socket | | root | unix_socket | +------+-------------+ #如果出现这样 需要把plugin置空 #UPDATE user SET plugin=""; #然后在定义root密码 UPDATE user SET password=PASSWORD("my_password") WHERE user="root"; #权限参数需要明确保存： FLUSH PRIVILEGES;说明此解决方案是在国外的博客上找到的 ，因为在我本地ubuntu 16.04安装lnmp的时候发现这问题。[scode type="red"]有一个UNIX_SOCKET插件，可以让您登录一个MariaDB帐户，而无需创建密码，因为它使用shell的凭据信任您，而无需输入任何密码。实际上，这个插件是一个认证插件，而不是与SQL服务器进行通信的方法。因此，如果不使用unix套接字作为登录方法，则可以安全地禁用它。[/scode]

MariaDB的yum安装方式的简单配置
type: item
date: 2017-10-03T02:50:00+00:00
description: 启动MariaDBsystemctl start mariadb设置开机启动systemctl enable mariadb接下来进行MariaDB的相关简单配置mysql_secure_installation首先是设置密码，会提示先输入密码Enter current password for root (enter for none):<–初次运行直接回车设置密码Set root password? [Y/n] <– 是否设置root用户密码，输入y并回车或直接回车New password: <– 设置root用户的密码Re-enter new password: <– 再输入一次你设置的密码其他配置Remove anonymous users? [Y/n] <– 是否删除匿名用户，回车Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车,Remove test database and access to it? [Y/n] <– 是否删除test数据库，回车Reload privilege tables now? [Y/n] <– 是否重新加载权限表，回车初始化MariaDB完成，接下来测试登录mysql -uroot -ppassword完成配置MariaDB的字符集文件/etc/my.cnfvi /etc/my.cnf添加[mysqld]init_connect='SET collation_connection = utf8_general_ci'init_connect='SET NAMES utf8'character-set-server=utf8collation-server=utf8_general_ciskip-character-set-client-handshake文件/etc/my.cnf.d/client.cnfvi /etc/my.cnf.d/client.cnf在[client]中添加default-character-set=utf8文件/etc/my.cnf.d/mysql-clients.cnfvi /etc/my.cnf.d/mysql-clients.cnf在[mysql]中添加default-character-set=utf8全部配置完成，重启mariadbsystemctl restart mariadb之后进入MariaDB查看字符集mysql> show variables like "%character%";show variables like "%collation%";显示为+————————–+—————————-+| Variable_name | Value |+————————–+—————————-+| character_set_client | utf8 || character_set_connection | utf8 || character_set_database | utf8 || character_set_filesystem | binary || character_set_results | utf8 || character_set_server | utf8 || character_set_system | utf8 || character_sets_dir | /usr/share/mysql/charsets/ |+————————–+—————————-+8 rows in set (0.00 sec)+———————-+—————–+| Variable_name | Value |+———————-+—————–+| collation_connection | utf8_unicode_ci || collation_database | utf8_unicode_ci || collation_server | utf8_unicode_ci |+———————-+—————–+3 rows in set (0.00 sec)字符集配置完成。添加用户，设置权限创建用户命令mysql>create user username@localhost identified by 'password';直接创建用户并授权的命令mysql>grant all on *.* to username@localhost indentified by 'password';授予外网登陆权限mysql>grant all privileges on *.* to username@'%' identified by 'password';授予权限并且可以授权mysq…

Elementary os 0.4 安装环境
type: item
date: 2017-05-03T06:54:00+00:00
description: Elementary Os是ubuntu的衍生版本。当时号称最美的linux系统。当时为了锻炼linux能力。在虚拟机上安装工作环境升级系统软件包在安装软件包之前，更新一下软件源并升级系统软件包总是有好处的。sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade完了之后先打命令sudo apt-get install -y language-pack-en-base这个包是为了结局系统不同语言之间可能发生的冲突，（有的ubuntu是自带的）安装之后可以减少许多引语言编码带来的问题。其中-y参数表明直接安装，无需确认.安装完成之后，运行locale-gen en_US.UTF-8安装依赖包[scode type="share"]sudo apt–get install build-essential 已有(代表系统自带)sudo apt–get install openssl sudo apt-get install autoconf sudo apt–get install libssl-dev sudo apt–get install make 已有sudo apt–get install curlsudo apt–get install libcurl4-gnutls-dev[/scode]下面系统没有的依赖可以直接安装sudo apt-get install libkrb5-dev \ libc-client2007e \ libc-client2007e-dev \ libcurl4-openssl-dev \ libbz2-dev \ libjpeg-dev \ libmcrypt-dev \ libxslt1-dev \ libxslt1.1 \ libpq-dev \ libpng12-dev \ libfreetype6-dev \ build-essential \安装nginxapt-get install nginxwhich nginx 查找nginx命令的所在位置也是安装包位置。然后增加用户webadmin。安装数据库apt-get install mariadb-server mariadb-client(mariaDB完全兼容mysql）其实安装这两个就可以。也可以apt-get install mariadb mariadb-* (我是这么安装的)安装数据库全部。数据的源码速度实在编译特别慢。直接apt-get或yum就行效率更快。最后一步安装PHP用wget 下载安装或者在浏览器下载都行 然后用tar -xvf php-7.1.6.tar.bz2解压./configure \ –prefix=/opt/php-7.1.6 \ –with-config-file-path=/opt/php-7.1.6/etc \ –with-zlib-dir \ –with-freetype-dir \ –enable-mbstring \ –with-libxml-dir=/usr \ –enable-soap \ –enable-calendar \ –with-curl \ –with-mcrypt \ –with-zlib \ –with-gd \ –disable-rpath \ –enable-inline-optimization \ –with-bz2 \ –with-zlib \ –enable-sockets \ –enable-sysvsem \ –enable-sysvshm \ –enable-pcntl \ –enable-mbregex \ –enable-exif \ –enable-bcmath \ –with-mhash \ –enable-zip \ –with-pcre-regex \ –with-pdo-mysql \ –with-mysqli \ –with-mysql-sock=/var/run/mysqld/mysqld.sock \ –with-jpeg-dir=/usr \ –with-png-dir=/usr \ –enable-gd-native-ttf \ –with-openssl \ –with-fpm-user=webadmin \ –with-fpm-group=webadmin \ –enable-ftp \ –with-imap \ –with-imap-ssl \ –with-kerberos \ –with-gettext \ –with-xmlrpc \ –with-xsl \ –enable-opcache \ –enable-fpm \ –enable-m…