바이두 클라우드 debian9 서버 설정

6277 단어
우선 debian 국내 거울 사이트를 추가합니다https://www.debian.org/mirror/list
중국 대륙 ftp2.cn.debian.org/debian/amd64 arm64 armel armhf hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips64el mipsel powerpc ppc64el s390 s390 x sparc 중국 대륙 ftp.cn.debian.org/debian/amd64 arm64 armel armhf hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mips64el mipsel powerpc ppc64el s390 s390x sparc
why?
If you install Debian 9 system using a netinstall CD image, your system probably will not have all the necessary repositories (from which you can install common packages), included in the apt sources list file. This can result into error like “E: unable to locate package package-name”. In this article, I will explain how to fix the “E: unable to locate package package-name” error in Debian 9 distribution.
 you need to add the necessary Debian software repositories in your /etc/apt/sources.list file:     
deb  http://deb.debian.org/debian  stretch main
deb-src  http://deb.debian.org/debian  stretch main
#apt update && apt upgrade

다음은 기본 도구vim,screen 등을 설치합니다.
apt-get install vim screen

사용하기 편리하도록/etc/vim/vimrc 파일 뒤에 다음 세 마디를 추가해야 한다
set nu  #    
syntax on  #    
set tabstop=4  #tab   

다음은 자바 환경을 설정하고 외국인을 직접 인용합니다
Step 1 – Add Java 8 PPA The webupd8 team has built a Java installer package for Debian systems. You need to add that PPA repository to your system for installing Java 8 on Debian.
Create a new Apt configuration file/etc/apt/sources.list.d/java-8-debian.list, and edit in text editor.
sudo vim /etc/apt/sources.list.d/java-8-debian.list

and add following content in it.
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main

Now import GPG key on your system for validating packages before installing them.
sudo apt-key adv --keyserver 
keyserver.ubuntu.com --recv-keys EEA14886

Step 2 – Install Java 8 on Debian You are all set to start Java installation on Debian. Run the following commands to update apt-cache and then install Java 8 on Debian system using the apt-get package manager.
sudo apt-get update
sudo apt-get install oracle-java8-installer

The installer will prompt for accept Oracle terms in order to continue Java installation on Debian. Accept the terms and complete setup.
Step 3 – Verify Java Installation Finally, you have successfully installed Oracle Java on your Debian system. Let’s use the following command to verify installed version of Java on your system.
java -version

java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Step 4 – Setup Java Environment The Webupd8 PPA repository also provides a package to set environment variables, Install this package using the following command.
sudo apt-get install oracle-java8-set-default

mysql 설치https://downloads.mariadb.org/mariadb/repositories/#version=10.4&distro_release=stretch--stretch&distro=Debian&mirror=tuna
Here are the commands to run to add MariaDB to your system:
sudo apt-get install software-properties-common dirmngr
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.4/debian stretch main'

Once the key is imported and the repository added you can install MariaDB with:
sudo apt-get update
sudo apt-get install mariadb-server

오류가 발생했습니다.
ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’ 1. Then I realized that I can login without password if I use sudo (of-course I have to enter the sudo password):
$ sudo mysql -u -p
So I’s looking around on the Internet and figure out the problem. In Ubuntu 16.04, mysql is using by default the UNIX auth_socket plugin which means that db users will be authenticated by the system user credentials.
$ sudo mysql -u root
mysql> USE mysql; mysql> SELECT User, Host, plugin FROM mysql.user;
±-------------±------------------+ | User | plugin | ±-------------±------------------+ | root | auth_socket |
So to login to mysql without sudo and use the password, I have to set the root (or any user) user to use the mysql_native_password plugin:
$ sudo mysql -u root
mysql> USE mysql; mysql> UPDATE user SET plugin=‘mysql_native_password’ WHERE User=‘root’; mysql> FLUSH PRIVILEGES; mysql> exit;
$ sudo systemctl restart mysql


  • https://mariadb.com/kb/en/library/set-password/
    SET PASSWORD FOR ‘bob’@’%.loc.gov’ = PASSWORD(‘newpass’);

    좋은 웹페이지 즐겨찾기