我遇到了这个问题,我无法安装任何模块。即使当我尝试注册时,我也会收到此错误。任何解决此问题的想法都值得赞赏。
PS C:\Users\abc> Register-PSRepository -Name PSGallery -SourceLocation https://www.powershellgallery.com/api/v2
Get-PSGalleryApiAvailability : PowerShell Gallery is currently unavailable. Please try again later.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4095 char:9
+ Get-PSGalleryApiAvailability -Repository $Name
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-PSGalleryApiAvailability], InvalidOperationException
+ FullyQualifiedErrorId : PowerShellGalleryUnavailable,Get-PSGalleryApiAvailability
Register-PSRepository : Use 'Register-PSRepository -Default' to register the PSGallery repository.
At line:1 char:1
+ Register-PSRepository -Name PSGallery -SourceLocation https://www.pow ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (PSGallery:String) [Register-PSRepository], ArgumentException
+ FullyQualifiedErrorId : UseDefaultParameterSetOnRegisterPSRepository,Register-PSRepository
PS C:\Users\abc> $PSVersionTable
Name Value
---- ----- …Run Code Online (Sandbox Code Playgroud) 这是我的MySQL
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: abc-def-my-mysql
namespace: abc-sk-test
labels:
project: abc
ca: my
spec:
replicas: 1
template:
metadata:
labels:
app: abc-def-my-mysql
project: abc
ca: my
spec:
containers:
- name: mysql
image: mysql:5.6
args: ["--default-authentication-plugin=mysql_native_password", "--ignore-db-dir=lost+found"]
ports:
- containerPort: 3306
env:
- name: MYSQL_ROOT_PASSWORD
value: "root"
- name: MYSQL_DATABASE
value: "my_abc"
- name: MYSQL_USER
value: "test_user"
- name: MYSQL_PASSWORD
value: "12345"
volumeMounts:
- mountPath: /var/lib/mysql
name: abc-def-my-mysql-storage
volumes:
- name: abc-def-my-mysql-storage
persistentVolumeClaim:
claimName: abc-def-my-mysql-pvc
Run Code Online (Sandbox Code Playgroud)
我想向 mysql 添加另一个用户,以便真正的用户可以连接到它。而不是使用“test_user”。如何添加另一个用户,是否像在上述配置中添加任何其他环境变量一样
如果我这样做
fis = new FileInputStream(new File(".").getAbsolutePath() + "/sudoinput.txt");
Run Code Online (Sandbox Code Playgroud)
它试图写入服务器上的这个位置。我不确定这是否是一个可写的地方。
FILE NAME (fos)::::::::::::::::::/opt/tomcat/temp/./sudoinput.txt
FILE NAME (fis)::::::::::::::::::/opt/tomcat/temp/./sudoinput.txt
Run Code Online (Sandbox Code Playgroud)
我想写入 webapps/sudoku/WEB-INF/classes 基本上是 C:\Users...\git\sudo-project\sudo\src\main\resources
在 Eclipse Windows 7 上,如果我给出这个错误 src\main\resources\sudoinput.txt (The system cannot find the path specified)
fis = new FileInputStream("src/main/resources/sudoinput.txt");
Run Code Online (Sandbox Code Playgroud)
我也试过这个:
fis = new FileInputStream("src\\main\\resources\\sudoinput.txt");
Run Code Online (Sandbox Code Playgroud)
但不起作用。
我应该如何创建一个 fileinputstream 才能写入 src/main/resources ?请注意,我正在使用 eclipse windows 进行开发,如果这改变了需要指定路径的方式,我会将 .war 文件上传到 unix 服务器。