通过这些可以减少一些编码量,减少一些错误的可能。
这些框架就是所谓的“不要重复造轮子”的“轮子”。
如果不使用这样现有的框架,轮子,就是要直接写代码,也是可以的。不过就要费力很多了。
如果有帮助到你,请点击采纳。
借鉴:
https://blog.csdn.net/YKWNDY/article/details/107025041
https://blog.csdn.net/weixin_41919735/article/details/122554337
cd /usr/local
将部署包:mysql-5.7.27-aarch64.tar.gz 上传到 /usr/local 下
tar xvf mysql-5.7.27-aarch64.tar.gz
mv /usr/local/mysql-5.7.27-aarch64 /usr/local/mysql
mkdir -p /usr/local/mysql/logs
ln -sf /usr/local/mysql/my.cnf /etc/my.cnf
cp -rf /usr/local/mysql/extra/lib* /usr/lib64/
mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.old
ln -s /usr/lib64/libstdc++.so.6.0.24 /usr/lib64/libstdc++.so.6
groupadd mysql
useradd -g mysql mysql
chown -R mysql:mysql /usr/local/mysql
cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
systemctl enable mysqld
vim /etc/profile
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
source /etc/profile
mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
systemctl start mysqld
systemctl status mysqld
移动文件 mv /usr/local/mysql-5.7.27-aarch64 /usr/local/mysql
创建logs目录 mkdir -p /usr/local/mysql/logs
ln -sf a b 建立软连接,b指向a:ln -sf /usr/local/mysql/my.cnf /etc/my.cnf
cp是linux里的拷贝命令-r 是用于目录拷贝时的递归 *** 作-f 是强制覆盖:cp -rf /usr/local/mysql/extra/lib* /usr/lib64/
创建mysql组:ln -s /usr/lib64/libstdc++.so.6.0.24 /usr/lib64/libstdc++.so.6
创建mysql用户添加到mysql组:groupadd mysql &&useradd -g mysql mysql
将/usr/loca/mysql目录包含所有的子目录和文件,所有者改变为root,所属组改变为mysql:chown -R mysql:mysql /usr/local/mysql
设置开机启动:
cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
systemctl enable mysqld
添加环境变量:
vim /etc/profile
export MYSQL_HOME=/usr/local/mysql
export PATH=PATH:PATH:PATH:MYSQL_HOME/bin
source /etc/profile
初始化mysql:mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
开启mysql:systemctl start mysqld
查看状态:systemctl status mysqld
写个数据库连接工具类:public MySqlDataReader GetData()
{string connection = "server=localhostuser id=rootpassword=123456database=ABCpooling=true"
MySqlConnection conn = new MySqlConnection(connection) string sqlQuery = "SELECT * FROM Article"
MySqlCommand comm = new MySqlCommand(sqlQuery, conn)
conn.Open()
MySqlDataReader dr = comm.ExecuteReader()
conn.Close() return dr
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)